aboutsummaryrefslogtreecommitdiff
path: root/doc/docs
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2026-02-28 16:52:40 +0800
committerLi Jin <dragon-fly@qq.com>2026-02-28 16:52:40 +0800
commit394ee0f64a0dc022f1dab86213d4771982ecf987 (patch)
tree742623d81f4fdd5a2c4998a7735634fcd79ac5e9 /doc/docs
parent7555271be61990fd5020eac48fc80d6a24886b9c (diff)
downloadyuescript-394ee0f64a0dc022f1dab86213d4771982ecf987.tar.gz
yuescript-394ee0f64a0dc022f1dab86213d4771982ecf987.tar.bz2
yuescript-394ee0f64a0dc022f1dab86213d4771982ecf987.zip
Updated docs.
Diffstat (limited to 'doc/docs')
-rw-r--r--doc/docs/de/doc/language-basics/operator.md26
-rw-r--r--doc/docs/doc/language-basics/operator.md26
-rw-r--r--doc/docs/id-id/doc/language-basics/operator.md26
-rw-r--r--doc/docs/pt-br/doc/language-basics/operator.md26
-rw-r--r--doc/docs/zh/doc/language-basics/operator.md26
5 files changed, 130 insertions, 0 deletions
diff --git a/doc/docs/de/doc/language-basics/operator.md b/doc/docs/de/doc/language-basics/operator.md
index 3be5ec8..5deec6a 100644
--- a/doc/docs/de/doc/language-basics/operator.md
+++ b/doc/docs/de/doc/language-basics/operator.md
@@ -138,6 +138,8 @@ tbA[] = ...tbB
138 138
139Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen. 139Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen.
140 140
141Wenn in ein Tabellenliteral mit geschweiften Klammern gespreadet wird (zum Beispiel `{...other}`), werden sowohl der Array-Teil als auch der Hash-Teil der Lua-Tabelle kopiert.
142
141```yuescript 143```yuescript
142parts = 144parts =
143 * "Schultern" 145 * "Schultern"
@@ -176,6 +178,30 @@ merge = {...a, ...b}
176 178
177</YueDisplay> 179</YueDisplay>
178 180
181### List-Tabellen-Spread
182
183Wenn in ein Tabellenliteral mit eckigen Klammern gespreadet wird (zum Beispiel `[...other,]`), wird nur der Array-Teil kopiert.
184
185```yuescript
186source = {1, 2, 3, name: "Yue"}
187fullCopy = {...source}
188listCopy = [...source,]
189-- fullCopy => {1, 2, 3, name: "Yue"}
190-- listCopy => [1, 2, 3]
191```
192
193<YueDisplay>
194
195```yue
196source = {1, 2, 3, name: "Yue"}
197fullCopy = {...source}
198listCopy = [...source,]
199-- fullCopy => {1, 2, 3, name: "Yue"}
200-- listCopy => [1, 2, 3]
201```
202
203</YueDisplay>
204
179## Umgekehrter Tabellenindex 205## Umgekehrter Tabellenindex
180 206
181Mit dem Operator **#** kannst du auf die letzten Elemente einer Tabelle zugreifen. 207Mit dem Operator **#** kannst du auf die letzten Elemente einer Tabelle zugreifen.
diff --git a/doc/docs/doc/language-basics/operator.md b/doc/docs/doc/language-basics/operator.md
index caeb6f4..067aa66 100644
--- a/doc/docs/doc/language-basics/operator.md
+++ b/doc/docs/doc/language-basics/operator.md
@@ -138,6 +138,8 @@ tbA[] = ...tbB
138 138
139You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals. 139You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals.
140 140
141When spreading into a brace table literal (for example, `{...other}`), both the array part and hash part of the Lua table are copied.
142
141```yuescript 143```yuescript
142parts = 144parts =
143 * "shoulders" 145 * "shoulders"
@@ -176,6 +178,30 @@ merge = {...a, ...b}
176 178
177</YueDisplay> 179</YueDisplay>
178 180
181### List Table Spreading
182
183When spreading into a bracket table literal (for example, `[...other,]`), only the array part is copied.
184
185```yuescript
186source = {1, 2, 3, name: "Yue"}
187fullCopy = {...source}
188listCopy = [...source,]
189-- fullCopy => {1, 2, 3, name: "Yue"}
190-- listCopy => [1, 2, 3]
191```
192
193<YueDisplay>
194
195```yue
196source = {1, 2, 3, name: "Yue"}
197fullCopy = {...source}
198listCopy = [...source,]
199-- fullCopy => {1, 2, 3, name: "Yue"}
200-- listCopy => [1, 2, 3]
201```
202
203</YueDisplay>
204
179## Table Reversed Indexing 205## Table Reversed Indexing
180 206
181You can use the **#** operator to get the last elements of a table. 207You can use the **#** operator to get the last elements of a table.
diff --git a/doc/docs/id-id/doc/language-basics/operator.md b/doc/docs/id-id/doc/language-basics/operator.md
index b2b1003..68c96e6 100644
--- a/doc/docs/id-id/doc/language-basics/operator.md
+++ b/doc/docs/id-id/doc/language-basics/operator.md
@@ -138,6 +138,8 @@ tbA[] = ...tbB
138 138
139Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. 139Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel.
140 140
141Saat melakukan spread ke literal tabel dengan kurung kurawal (misalnya `{...other}`), bagian array dan bagian hash dari tabel Lua akan disalin.
142
141```yuescript 143```yuescript
142parts = 144parts =
143 * "shoulders" 145 * "shoulders"
@@ -176,6 +178,30 @@ merge = {...a, ...b}
176 178
177</YueDisplay> 179</YueDisplay>
178 180
181### Penyebaran Tabel List
182
183Saat melakukan spread ke literal tabel dengan kurung siku (misalnya `[...other,]`), hanya bagian array yang disalin.
184
185```yuescript
186source = {1, 2, 3, name: "Yue"}
187fullCopy = {...source}
188listCopy = [...source,]
189-- fullCopy => {1, 2, 3, name: "Yue"}
190-- listCopy => [1, 2, 3]
191```
192
193<YueDisplay>
194
195```yue
196source = {1, 2, 3, name: "Yue"}
197fullCopy = {...source}
198listCopy = [...source,]
199-- fullCopy => {1, 2, 3, name: "Yue"}
200-- listCopy => [1, 2, 3]
201```
202
203</YueDisplay>
204
179## Indeks Balik Tabel 205## Indeks Balik Tabel
180 206
181Anda dapat menggunakan operator **#** untuk mendapatkan elemen terakhir dari tabel. 207Anda dapat menggunakan operator **#** untuk mendapatkan elemen terakhir dari tabel.
diff --git a/doc/docs/pt-br/doc/language-basics/operator.md b/doc/docs/pt-br/doc/language-basics/operator.md
index e0c0872..976cb43 100644
--- a/doc/docs/pt-br/doc/language-basics/operator.md
+++ b/doc/docs/pt-br/doc/language-basics/operator.md
@@ -138,6 +138,8 @@ tbA[] = ...tbB
138 138
139Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela. 139Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela.
140 140
141Ao fazer spread em um literal de tabela com chaves (por exemplo, `{...other}`), tanto a parte de array quanto a parte hash da tabela Lua são copiadas.
142
141```yuescript 143```yuescript
142parts = 144parts =
143 * "shoulders" 145 * "shoulders"
@@ -176,6 +178,30 @@ merge = {...a, ...b}
176 178
177</YueDisplay> 179</YueDisplay>
178 180
181### Spread de tabela de lista
182
183Ao fazer spread em um literal de tabela com colchetes (por exemplo, `[...other,]`), apenas a parte de array é copiada.
184
185```yuescript
186source = {1, 2, 3, name: "Yue"}
187fullCopy = {...source}
188listCopy = [...source,]
189-- fullCopy => {1, 2, 3, name: "Yue"}
190-- listCopy => [1, 2, 3]
191```
192
193<YueDisplay>
194
195```yue
196source = {1, 2, 3, name: "Yue"}
197fullCopy = {...source}
198listCopy = [...source,]
199-- fullCopy => {1, 2, 3, name: "Yue"}
200-- listCopy => [1, 2, 3]
201```
202
203</YueDisplay>
204
179## Indexação reversa de tabela 205## Indexação reversa de tabela
180 206
181Você pode usar o operador **#** para obter os últimos elementos de uma tabela. 207Você pode usar o operador **#** para obter os últimos elementos de uma tabela.
diff --git a/doc/docs/zh/doc/language-basics/operator.md b/doc/docs/zh/doc/language-basics/operator.md
index fc2a49d..6e3721f 100644
--- a/doc/docs/zh/doc/language-basics/operator.md
+++ b/doc/docs/zh/doc/language-basics/operator.md
@@ -138,6 +138,8 @@ tbA[] = ...tbB
138 138
139&emsp;&emsp;你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。 139&emsp;&emsp;你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。
140 140
141&emsp;&emsp;使用花括号字面量做表扩展(例如 `{...other}`)时,会复制 Lua 表中的数组部分和哈希部分。
142
141```yuescript 143```yuescript
142parts = 144parts =
143 * "shoulders" 145 * "shoulders"
@@ -176,6 +178,30 @@ merge = {...a, ...b}
176 178
177</YueDisplay> 179</YueDisplay>
178 180
181### 列表表扩展
182
183&emsp;&emsp;使用中括号字面量做表扩展(例如 `[...other,]`)时,只会复制 Lua 表中的数组部分。
184
185```yuescript
186source = {1, 2, 3, name: "Yue"}
187fullCopy = {...source}
188listCopy = [...source,]
189-- fullCopy => {1, 2, 3, name: "Yue"}
190-- listCopy => [1, 2, 3]
191```
192
193<YueDisplay>
194
195```yue
196source = {1, 2, 3, name: "Yue"}
197fullCopy = {...source}
198listCopy = [...source,]
199-- fullCopy => {1, 2, 3, name: "Yue"}
200-- listCopy => [1, 2, 3]
201```
202
203</YueDisplay>
204
179## 表反向索引 205## 表反向索引
180 206
181&emsp;&emsp;你可以使用 **#** 操作符来反向索引表中的元素。 207&emsp;&emsp;你可以使用 **#** 操作符来反向索引表中的元素。