diff options
| -rw-r--r-- | doc/docs/de/doc/language-basics/operator.md | 26 | ||||
| -rw-r--r-- | doc/docs/doc/language-basics/operator.md | 26 | ||||
| -rw-r--r-- | doc/docs/id-id/doc/language-basics/operator.md | 26 | ||||
| -rw-r--r-- | doc/docs/pt-br/doc/language-basics/operator.md | 26 | ||||
| -rw-r--r-- | doc/docs/zh/doc/language-basics/operator.md | 26 | ||||
| -rw-r--r-- | doc/yue-de.md | 14 | ||||
| -rw-r--r-- | doc/yue-en.md | 14 | ||||
| -rw-r--r-- | doc/yue-id-id.md | 14 | ||||
| -rw-r--r-- | doc/yue-pt-br.md | 14 | ||||
| -rw-r--r-- | doc/yue-zh.md | 14 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_de.lua | 58 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_en.lua | 58 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_id-id.lua | 58 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_pt-br.lua | 58 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_zh.lua | 58 |
15 files changed, 490 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 | ||
| 139 | Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen. | 139 | Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen. |
| 140 | 140 | ||
| 141 | Wenn 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 |
| 142 | parts = | 144 | parts = |
| 143 | * "Schultern" | 145 | * "Schultern" |
| @@ -176,6 +178,30 @@ merge = {...a, ...b} | |||
| 176 | 178 | ||
| 177 | </YueDisplay> | 179 | </YueDisplay> |
| 178 | 180 | ||
| 181 | ### List-Tabellen-Spread | ||
| 182 | |||
| 183 | Wenn in ein Tabellenliteral mit eckigen Klammern gespreadet wird (zum Beispiel `[...other,]`), wird nur der Array-Teil kopiert. | ||
| 184 | |||
| 185 | ```yuescript | ||
| 186 | source = {1, 2, 3, name: "Yue"} | ||
| 187 | fullCopy = {...source} | ||
| 188 | listCopy = [...source,] | ||
| 189 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 190 | -- listCopy => [1, 2, 3] | ||
| 191 | ``` | ||
| 192 | |||
| 193 | <YueDisplay> | ||
| 194 | |||
| 195 | ```yue | ||
| 196 | source = {1, 2, 3, name: "Yue"} | ||
| 197 | fullCopy = {...source} | ||
| 198 | listCopy = [...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 | ||
| 181 | Mit dem Operator **#** kannst du auf die letzten Elemente einer Tabelle zugreifen. | 207 | Mit 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 | ||
| 139 | You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals. | 139 | You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals. |
| 140 | 140 | ||
| 141 | When 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 |
| 142 | parts = | 144 | parts = |
| 143 | * "shoulders" | 145 | * "shoulders" |
| @@ -176,6 +178,30 @@ merge = {...a, ...b} | |||
| 176 | 178 | ||
| 177 | </YueDisplay> | 179 | </YueDisplay> |
| 178 | 180 | ||
| 181 | ### List Table Spreading | ||
| 182 | |||
| 183 | When spreading into a bracket table literal (for example, `[...other,]`), only the array part is copied. | ||
| 184 | |||
| 185 | ```yuescript | ||
| 186 | source = {1, 2, 3, name: "Yue"} | ||
| 187 | fullCopy = {...source} | ||
| 188 | listCopy = [...source,] | ||
| 189 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 190 | -- listCopy => [1, 2, 3] | ||
| 191 | ``` | ||
| 192 | |||
| 193 | <YueDisplay> | ||
| 194 | |||
| 195 | ```yue | ||
| 196 | source = {1, 2, 3, name: "Yue"} | ||
| 197 | fullCopy = {...source} | ||
| 198 | listCopy = [...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 | ||
| 181 | You can use the **#** operator to get the last elements of a table. | 207 | You 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 | ||
| 139 | Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. | 139 | Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. |
| 140 | 140 | ||
| 141 | Saat 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 |
| 142 | parts = | 144 | parts = |
| 143 | * "shoulders" | 145 | * "shoulders" |
| @@ -176,6 +178,30 @@ merge = {...a, ...b} | |||
| 176 | 178 | ||
| 177 | </YueDisplay> | 179 | </YueDisplay> |
| 178 | 180 | ||
| 181 | ### Penyebaran Tabel List | ||
| 182 | |||
| 183 | Saat melakukan spread ke literal tabel dengan kurung siku (misalnya `[...other,]`), hanya bagian array yang disalin. | ||
| 184 | |||
| 185 | ```yuescript | ||
| 186 | source = {1, 2, 3, name: "Yue"} | ||
| 187 | fullCopy = {...source} | ||
| 188 | listCopy = [...source,] | ||
| 189 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 190 | -- listCopy => [1, 2, 3] | ||
| 191 | ``` | ||
| 192 | |||
| 193 | <YueDisplay> | ||
| 194 | |||
| 195 | ```yue | ||
| 196 | source = {1, 2, 3, name: "Yue"} | ||
| 197 | fullCopy = {...source} | ||
| 198 | listCopy = [...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 | ||
| 181 | Anda dapat menggunakan operator **#** untuk mendapatkan elemen terakhir dari tabel. | 207 | Anda 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 | ||
| 139 | Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela. | 139 | Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela. |
| 140 | 140 | ||
| 141 | Ao 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 |
| 142 | parts = | 144 | parts = |
| 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 | |||
| 183 | Ao fazer spread em um literal de tabela com colchetes (por exemplo, `[...other,]`), apenas a parte de array é copiada. | ||
| 184 | |||
| 185 | ```yuescript | ||
| 186 | source = {1, 2, 3, name: "Yue"} | ||
| 187 | fullCopy = {...source} | ||
| 188 | listCopy = [...source,] | ||
| 189 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 190 | -- listCopy => [1, 2, 3] | ||
| 191 | ``` | ||
| 192 | |||
| 193 | <YueDisplay> | ||
| 194 | |||
| 195 | ```yue | ||
| 196 | source = {1, 2, 3, name: "Yue"} | ||
| 197 | fullCopy = {...source} | ||
| 198 | listCopy = [...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 | ||
| 181 | Você pode usar o operador **#** para obter os últimos elementos de uma tabela. | 207 | Você 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 |   你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。 | 139 |   你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。 |
| 140 | 140 | ||
| 141 |   使用花括号字面量做表扩展(例如 `{...other}`)时,会复制 Lua 表中的数组部分和哈希部分。 | ||
| 142 | |||
| 141 | ```yuescript | 143 | ```yuescript |
| 142 | parts = | 144 | parts = |
| 143 | * "shoulders" | 145 | * "shoulders" |
| @@ -176,6 +178,30 @@ merge = {...a, ...b} | |||
| 176 | 178 | ||
| 177 | </YueDisplay> | 179 | </YueDisplay> |
| 178 | 180 | ||
| 181 | ### 列表表扩展 | ||
| 182 | |||
| 183 |   使用中括号字面量做表扩展(例如 `[...other,]`)时,只会复制 Lua 表中的数组部分。 | ||
| 184 | |||
| 185 | ```yuescript | ||
| 186 | source = {1, 2, 3, name: "Yue"} | ||
| 187 | fullCopy = {...source} | ||
| 188 | listCopy = [...source,] | ||
| 189 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 190 | -- listCopy => [1, 2, 3] | ||
| 191 | ``` | ||
| 192 | |||
| 193 | <YueDisplay> | ||
| 194 | |||
| 195 | ```yue | ||
| 196 | source = {1, 2, 3, name: "Yue"} | ||
| 197 | fullCopy = {...source} | ||
| 198 | listCopy = [...source,] | ||
| 199 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 200 | -- listCopy => [1, 2, 3] | ||
| 201 | ``` | ||
| 202 | |||
| 203 | </YueDisplay> | ||
| 204 | |||
| 179 | ## 表反向索引 | 205 | ## 表反向索引 |
| 180 | 206 | ||
| 181 |   你可以使用 **#** 操作符来反向索引表中的元素。 | 207 |   你可以使用 **#** 操作符来反向索引表中的元素。 |
diff --git a/doc/yue-de.md b/doc/yue-de.md index aeaabf1..f0979e0 100644 --- a/doc/yue-de.md +++ b/doc/yue-de.md | |||
| @@ -2217,6 +2217,8 @@ tbA[] = ...tbB | |||
| 2217 | 2217 | ||
| 2218 | Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen. | 2218 | Du kannst Array-Tabellen oder Hash-Tabellen mit dem Spread-Operator `...` vor Ausdrücken in Tabellenliteralen zusammenführen. |
| 2219 | 2219 | ||
| 2220 | Wenn 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. | ||
| 2221 | |||
| 2220 | ```yuescript | 2222 | ```yuescript |
| 2221 | parts = | 2223 | parts = |
| 2222 | * "Schultern" | 2224 | * "Schultern" |
| @@ -2234,6 +2236,18 @@ b = {4, 5, y: 1} | |||
| 2234 | merge = {...a, ...b} | 2236 | merge = {...a, ...b} |
| 2235 | ``` | 2237 | ``` |
| 2236 | 2238 | ||
| 2239 | ### List-Tabellen-Spread | ||
| 2240 | |||
| 2241 | Wenn in ein Tabellenliteral mit eckigen Klammern gespreadet wird (zum Beispiel `[...other,]`), wird nur der Array-Teil kopiert. | ||
| 2242 | |||
| 2243 | ```yuescript | ||
| 2244 | source = {1, 2, 3, name: "Yue"} | ||
| 2245 | fullCopy = {...source} | ||
| 2246 | listCopy = [...source,] | ||
| 2247 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 2248 | -- listCopy => [1, 2, 3] | ||
| 2249 | ``` | ||
| 2250 | |||
| 2237 | ## Umgekehrter Tabellenindex | 2251 | ## Umgekehrter Tabellenindex |
| 2238 | 2252 | ||
| 2239 | Mit dem Operator **#** kannst du auf die letzten Elemente einer Tabelle zugreifen. | 2253 | Mit dem Operator **#** kannst du auf die letzten Elemente einer Tabelle zugreifen. |
diff --git a/doc/yue-en.md b/doc/yue-en.md index 2cac78a..6680281 100644 --- a/doc/yue-en.md +++ b/doc/yue-en.md | |||
| @@ -2219,6 +2219,8 @@ tbA[] = ...tbB | |||
| 2219 | 2219 | ||
| 2220 | You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals. | 2220 | You can concatenate array tables or hash tables using spread operator `...` before expressions in table literals. |
| 2221 | 2221 | ||
| 2222 | When spreading into a brace table literal (for example, `{...other}`), both the array part and hash part of the Lua table are copied. | ||
| 2223 | |||
| 2222 | ```yuescript | 2224 | ```yuescript |
| 2223 | parts = | 2225 | parts = |
| 2224 | * "shoulders" | 2226 | * "shoulders" |
| @@ -2236,6 +2238,18 @@ b = {4, 5, y: 1} | |||
| 2236 | merge = {...a, ...b} | 2238 | merge = {...a, ...b} |
| 2237 | ``` | 2239 | ``` |
| 2238 | 2240 | ||
| 2241 | ### List Table Spreading | ||
| 2242 | |||
| 2243 | When spreading into a bracket table literal (for example, `[...other,]`), only the array part is copied. | ||
| 2244 | |||
| 2245 | ```yuescript | ||
| 2246 | source = {1, 2, 3, name: "Yue"} | ||
| 2247 | fullCopy = {...source} | ||
| 2248 | listCopy = [...source,] | ||
| 2249 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 2250 | -- listCopy => [1, 2, 3] | ||
| 2251 | ``` | ||
| 2252 | |||
| 2239 | ## Table Reversed Indexing | 2253 | ## Table Reversed Indexing |
| 2240 | 2254 | ||
| 2241 | You can use the **#** operator to get the last elements of a table. | 2255 | You can use the **#** operator to get the last elements of a table. |
diff --git a/doc/yue-id-id.md b/doc/yue-id-id.md index 73bf1bb..863e187 100644 --- a/doc/yue-id-id.md +++ b/doc/yue-id-id.md | |||
| @@ -2215,6 +2215,8 @@ tbA[] = ...tbB | |||
| 2215 | 2215 | ||
| 2216 | Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. | 2216 | Anda bisa menggabungkan tabel array atau tabel hash menggunakan operator spread `...` sebelum ekspresi di literal tabel. |
| 2217 | 2217 | ||
| 2218 | Saat melakukan spread ke literal tabel dengan kurung kurawal (misalnya `{...other}`), bagian array dan bagian hash dari tabel Lua akan disalin. | ||
| 2219 | |||
| 2218 | ```yuescript | 2220 | ```yuescript |
| 2219 | parts = | 2221 | parts = |
| 2220 | * "shoulders" | 2222 | * "shoulders" |
| @@ -2232,6 +2234,18 @@ b = {4, 5, y: 1} | |||
| 2232 | merge = {...a, ...b} | 2234 | merge = {...a, ...b} |
| 2233 | ``` | 2235 | ``` |
| 2234 | 2236 | ||
| 2237 | ### Penyebaran Tabel List | ||
| 2238 | |||
| 2239 | Saat melakukan spread ke literal tabel dengan kurung siku (misalnya `[...other,]`), hanya bagian array yang disalin. | ||
| 2240 | |||
| 2241 | ```yuescript | ||
| 2242 | source = {1, 2, 3, name: "Yue"} | ||
| 2243 | fullCopy = {...source} | ||
| 2244 | listCopy = [...source,] | ||
| 2245 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 2246 | -- listCopy => [1, 2, 3] | ||
| 2247 | ``` | ||
| 2248 | |||
| 2235 | ## Indeks Balik Tabel | 2249 | ## Indeks Balik Tabel |
| 2236 | 2250 | ||
| 2237 | Anda dapat menggunakan operator **#** untuk mendapatkan elemen terakhir dari tabel. | 2251 | Anda dapat menggunakan operator **#** untuk mendapatkan elemen terakhir dari tabel. |
diff --git a/doc/yue-pt-br.md b/doc/yue-pt-br.md index d48c19b..a1408c2 100644 --- a/doc/yue-pt-br.md +++ b/doc/yue-pt-br.md | |||
| @@ -2217,6 +2217,8 @@ tbA[] = ...tbB | |||
| 2217 | 2217 | ||
| 2218 | Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela. | 2218 | Você pode concatenar tabelas de array ou tabelas hash usando o operador spread `...` antes de expressões em literais de tabela. |
| 2219 | 2219 | ||
| 2220 | Ao 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. | ||
| 2221 | |||
| 2220 | ```yuescript | 2222 | ```yuescript |
| 2221 | parts = | 2223 | parts = |
| 2222 | * "shoulders" | 2224 | * "shoulders" |
| @@ -2234,6 +2236,18 @@ b = {4, 5, y: 1} | |||
| 2234 | merge = {...a, ...b} | 2236 | merge = {...a, ...b} |
| 2235 | ``` | 2237 | ``` |
| 2236 | 2238 | ||
| 2239 | ### Spread de tabela de lista | ||
| 2240 | |||
| 2241 | Ao fazer spread em um literal de tabela com colchetes (por exemplo, `[...other,]`), apenas a parte de array é copiada. | ||
| 2242 | |||
| 2243 | ```yuescript | ||
| 2244 | source = {1, 2, 3, name: "Yue"} | ||
| 2245 | fullCopy = {...source} | ||
| 2246 | listCopy = [...source,] | ||
| 2247 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 2248 | -- listCopy => [1, 2, 3] | ||
| 2249 | ``` | ||
| 2250 | |||
| 2237 | ## Indexação reversa de tabela | 2251 | ## Indexação reversa de tabela |
| 2238 | 2252 | ||
| 2239 | Você pode usar o operador **#** para obter os últimos elementos de uma tabela. | 2253 | Você pode usar o operador **#** para obter os últimos elementos de uma tabela. |
diff --git a/doc/yue-zh.md b/doc/yue-zh.md index dfc5996..ac7e4b2 100644 --- a/doc/yue-zh.md +++ b/doc/yue-zh.md | |||
| @@ -2207,6 +2207,8 @@ tbA[] = ...tbB | |||
| 2207 | 2207 | ||
| 2208 |   你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。 | 2208 |   你可以使用前置 `...` 操作符在 Lua 表中插入数组表或哈希表。 |
| 2209 | 2209 | ||
| 2210 |   使用花括号字面量做表扩展(例如 `{...other}`)时,会复制 Lua 表中的数组部分和哈希部分。 | ||
| 2211 | |||
| 2210 | ```yuescript | 2212 | ```yuescript |
| 2211 | parts = | 2213 | parts = |
| 2212 | * "shoulders" | 2214 | * "shoulders" |
| @@ -2224,6 +2226,18 @@ b = {4, 5, y: 1} | |||
| 2224 | merge = {...a, ...b} | 2226 | merge = {...a, ...b} |
| 2225 | ``` | 2227 | ``` |
| 2226 | 2228 | ||
| 2229 | ### 列表表扩展 | ||
| 2230 | |||
| 2231 |   使用中括号字面量做表扩展(例如 `[...other,]`)时,只会复制 Lua 表中的数组部分。 | ||
| 2232 | |||
| 2233 | ```yuescript | ||
| 2234 | source = {1, 2, 3, name: "Yue"} | ||
| 2235 | fullCopy = {...source} | ||
| 2236 | listCopy = [...source,] | ||
| 2237 | -- fullCopy => {1, 2, 3, name: "Yue"} | ||
| 2238 | -- listCopy => [1, 2, 3] | ||
| 2239 | ``` | ||
| 2240 | |||
| 2227 | ## 表反向索引 | 2241 | ## 表反向索引 |
| 2228 | 2242 | ||
| 2229 |   你可以使用 **#** 操作符来反向索引表中的元素。 | 2243 |   你可以使用 **#** 操作符来反向索引表中的元素。 |
diff --git a/spec/outputs/codes_from_doc_de.lua b/spec/outputs/codes_from_doc_de.lua index 6bb5f2a..d8115ee 100644 --- a/spec/outputs/codes_from_doc_de.lua +++ b/spec/outputs/codes_from_doc_de.lua | |||
| @@ -4613,6 +4613,35 @@ for _key_0, _value_0 in pairs(b) do | |||
| 4613 | end | 4613 | end |
| 4614 | end | 4614 | end |
| 4615 | merge = _tab_0 | 4615 | merge = _tab_0 |
| 4616 | local source = { | ||
| 4617 | 1, | ||
| 4618 | 2, | ||
| 4619 | 3, | ||
| 4620 | name = "Yue" | ||
| 4621 | } | ||
| 4622 | local fullCopy | ||
| 4623 | do | ||
| 4624 | local _tab_0 = { } | ||
| 4625 | local _idx_0 = 1 | ||
| 4626 | for _key_0, _value_0 in pairs(source) do | ||
| 4627 | if _idx_0 == _key_0 then | ||
| 4628 | _tab_0[#_tab_0 + 1] = _value_0 | ||
| 4629 | _idx_0 = _idx_0 + 1 | ||
| 4630 | else | ||
| 4631 | _tab_0[_key_0] = _value_0 | ||
| 4632 | end | ||
| 4633 | end | ||
| 4634 | fullCopy = _tab_0 | ||
| 4635 | end | ||
| 4636 | local listCopy | ||
| 4637 | local _tab_0 = { } | ||
| 4638 | local _idx_0 = #_tab_0 + 1 | ||
| 4639 | for _index_0 = 1, #source do | ||
| 4640 | local _value_0 = source[_index_0] | ||
| 4641 | _tab_0[_idx_0] = _value_0 | ||
| 4642 | _idx_0 = _idx_0 + 1 | ||
| 4643 | end | ||
| 4644 | listCopy = _tab_0 | ||
| 4616 | local last | 4645 | local last |
| 4617 | do | 4646 | do |
| 4618 | local _item_0 = data.items | 4647 | local _item_0 = data.items |
| @@ -4906,6 +4935,35 @@ for _key_0, _value_0 in pairs(b) do | |||
| 4906 | end | 4935 | end |
| 4907 | end | 4936 | end |
| 4908 | merge = _tab_0 | 4937 | merge = _tab_0 |
| 4938 | local source = { | ||
| 4939 | 1, | ||
| 4940 | 2, | ||
| 4941 | 3, | ||
| 4942 | name = "Yue" | ||
| 4943 | } | ||
| 4944 | local fullCopy | ||
| 4945 | do | ||
| 4946 | local _tab_0 = { } | ||
| 4947 | local _idx_0 = 1 | ||
| 4948 | for _key_0, _value_0 in pairs(source) do | ||
| 4949 | if _idx_0 == _key_0 then | ||
| 4950 | _tab_0[#_tab_0 + 1] = _value_0 | ||
| 4951 | _idx_0 = _idx_0 + 1 | ||
| 4952 | else | ||
| 4953 | _tab_0[_key_0] = _value_0 | ||
| 4954 | end | ||
| 4955 | end | ||
| 4956 | fullCopy = _tab_0 | ||
| 4957 | end | ||
| 4958 | local listCopy | ||
| 4959 | local _tab_0 = { } | ||
| 4960 | local _idx_0 = #_tab_0 + 1 | ||
| 4961 | for _index_0 = 1, #source do | ||
| 4962 | local _value_0 = source[_index_0] | ||
| 4963 | _tab_0[_idx_0] = _value_0 | ||
| 4964 | _idx_0 = _idx_0 + 1 | ||
| 4965 | end | ||
| 4966 | listCopy = _tab_0 | ||
| 4909 | local last | 4967 | local last |
| 4910 | do | 4968 | do |
| 4911 | local _item_0 = data.items | 4969 | local _item_0 = data.items |
diff --git a/spec/outputs/codes_from_doc_en.lua b/spec/outputs/codes_from_doc_en.lua index ec50f7e..66fb0b7 100644 --- a/spec/outputs/codes_from_doc_en.lua +++ b/spec/outputs/codes_from_doc_en.lua | |||
| @@ -4613,6 +4613,35 @@ for _key_0, _value_0 in pairs(b) do | |||
| 4613 | end | 4613 | end |
| 4614 | end | 4614 | end |
| 4615 | merge = _tab_0 | 4615 | merge = _tab_0 |
| 4616 | local source = { | ||
| 4617 | 1, | ||
| 4618 | 2, | ||
| 4619 | 3, | ||
| 4620 | name = "Yue" | ||
| 4621 | } | ||
| 4622 | local fullCopy | ||
| 4623 | do | ||
| 4624 | local _tab_0 = { } | ||
| 4625 | local _idx_0 = 1 | ||
| 4626 | for _key_0, _value_0 in pairs(source) do | ||
| 4627 | if _idx_0 == _key_0 then | ||
| 4628 | _tab_0[#_tab_0 + 1] = _value_0 | ||
| 4629 | _idx_0 = _idx_0 + 1 | ||
| 4630 | else | ||
| 4631 | _tab_0[_key_0] = _value_0 | ||
| 4632 | end | ||
| 4633 | end | ||
| 4634 | fullCopy = _tab_0 | ||
| 4635 | end | ||
| 4636 | local listCopy | ||
| 4637 | local _tab_0 = { } | ||
| 4638 | local _idx_0 = #_tab_0 + 1 | ||
| 4639 | for _index_0 = 1, #source do | ||
| 4640 | local _value_0 = source[_index_0] | ||
| 4641 | _tab_0[_idx_0] = _value_0 | ||
| 4642 | _idx_0 = _idx_0 + 1 | ||
| 4643 | end | ||
| 4644 | listCopy = _tab_0 | ||
| 4616 | local last | 4645 | local last |
| 4617 | do | 4646 | do |
| 4618 | local _item_0 = data.items | 4647 | local _item_0 = data.items |
| @@ -4906,6 +4935,35 @@ for _key_0, _value_0 in pairs(b) do | |||
| 4906 | end | 4935 | end |
| 4907 | end | 4936 | end |
| 4908 | merge = _tab_0 | 4937 | merge = _tab_0 |
| 4938 | local source = { | ||
| 4939 | 1, | ||
| 4940 | 2, | ||
| 4941 | 3, | ||
| 4942 | name = "Yue" | ||
| 4943 | } | ||
| 4944 | local fullCopy | ||
| 4945 | do | ||
| 4946 | local _tab_0 = { } | ||
| 4947 | local _idx_0 = 1 | ||
| 4948 | for _key_0, _value_0 in pairs(source) do | ||
| 4949 | if _idx_0 == _key_0 then | ||
| 4950 | _tab_0[#_tab_0 + 1] = _value_0 | ||
| 4951 | _idx_0 = _idx_0 + 1 | ||
| 4952 | else | ||
| 4953 | _tab_0[_key_0] = _value_0 | ||
| 4954 | end | ||
| 4955 | end | ||
| 4956 | fullCopy = _tab_0 | ||
| 4957 | end | ||
| 4958 | local listCopy | ||
| 4959 | local _tab_0 = { } | ||
| 4960 | local _idx_0 = #_tab_0 + 1 | ||
| 4961 | for _index_0 = 1, #source do | ||
| 4962 | local _value_0 = source[_index_0] | ||
| 4963 | _tab_0[_idx_0] = _value_0 | ||
| 4964 | _idx_0 = _idx_0 + 1 | ||
| 4965 | end | ||
| 4966 | listCopy = _tab_0 | ||
| 4909 | local last | 4967 | local last |
| 4910 | do | 4968 | do |
| 4911 | local _item_0 = data.items | 4969 | local _item_0 = data.items |
diff --git a/spec/outputs/codes_from_doc_id-id.lua b/spec/outputs/codes_from_doc_id-id.lua index c4795ac..6caf79c 100644 --- a/spec/outputs/codes_from_doc_id-id.lua +++ b/spec/outputs/codes_from_doc_id-id.lua | |||
| @@ -4613,6 +4613,35 @@ for _key_0, _value_0 in pairs(b) do | |||
| 4613 | end | 4613 | end |
| 4614 | end | 4614 | end |
| 4615 | merge = _tab_0 | 4615 | merge = _tab_0 |
| 4616 | local source = { | ||
| 4617 | 1, | ||
| 4618 | 2, | ||
| 4619 | 3, | ||
| 4620 | name = "Yue" | ||
| 4621 | } | ||
| 4622 | local fullCopy | ||
| 4623 | do | ||
| 4624 | local _tab_0 = { } | ||
| 4625 | local _idx_0 = 1 | ||
| 4626 | for _key_0, _value_0 in pairs(source) do | ||
| 4627 | if _idx_0 == _key_0 then | ||
| 4628 | _tab_0[#_tab_0 + 1] = _value_0 | ||
| 4629 | _idx_0 = _idx_0 + 1 | ||
| 4630 | else | ||
| 4631 | _tab_0[_key_0] = _value_0 | ||
| 4632 | end | ||
| 4633 | end | ||
| 4634 | fullCopy = _tab_0 | ||
| 4635 | end | ||
| 4636 | local listCopy | ||
| 4637 | local _tab_0 = { } | ||
| 4638 | local _idx_0 = #_tab_0 + 1 | ||
| 4639 | for _index_0 = 1, #source do | ||
| 4640 | local _value_0 = source[_index_0] | ||
| 4641 | _tab_0[_idx_0] = _value_0 | ||
| 4642 | _idx_0 = _idx_0 + 1 | ||
| 4643 | end | ||
| 4644 | listCopy = _tab_0 | ||
| 4616 | local last | 4645 | local last |
| 4617 | do | 4646 | do |
| 4618 | local _item_0 = data.items | 4647 | local _item_0 = data.items |
| @@ -4906,6 +4935,35 @@ for _key_0, _value_0 in pairs(b) do | |||
| 4906 | end | 4935 | end |
| 4907 | end | 4936 | end |
| 4908 | merge = _tab_0 | 4937 | merge = _tab_0 |
| 4938 | local source = { | ||
| 4939 | 1, | ||
| 4940 | 2, | ||
| 4941 | 3, | ||
| 4942 | name = "Yue" | ||
| 4943 | } | ||
| 4944 | local fullCopy | ||
| 4945 | do | ||
| 4946 | local _tab_0 = { } | ||
| 4947 | local _idx_0 = 1 | ||
| 4948 | for _key_0, _value_0 in pairs(source) do | ||
| 4949 | if _idx_0 == _key_0 then | ||
| 4950 | _tab_0[#_tab_0 + 1] = _value_0 | ||
| 4951 | _idx_0 = _idx_0 + 1 | ||
| 4952 | else | ||
| 4953 | _tab_0[_key_0] = _value_0 | ||
| 4954 | end | ||
| 4955 | end | ||
| 4956 | fullCopy = _tab_0 | ||
| 4957 | end | ||
| 4958 | local listCopy | ||
| 4959 | local _tab_0 = { } | ||
| 4960 | local _idx_0 = #_tab_0 + 1 | ||
| 4961 | for _index_0 = 1, #source do | ||
| 4962 | local _value_0 = source[_index_0] | ||
| 4963 | _tab_0[_idx_0] = _value_0 | ||
| 4964 | _idx_0 = _idx_0 + 1 | ||
| 4965 | end | ||
| 4966 | listCopy = _tab_0 | ||
| 4909 | local last | 4967 | local last |
| 4910 | do | 4968 | do |
| 4911 | local _item_0 = data.items | 4969 | local _item_0 = data.items |
diff --git a/spec/outputs/codes_from_doc_pt-br.lua b/spec/outputs/codes_from_doc_pt-br.lua index 927d05b..22f9bb9 100644 --- a/spec/outputs/codes_from_doc_pt-br.lua +++ b/spec/outputs/codes_from_doc_pt-br.lua | |||
| @@ -4613,6 +4613,35 @@ for _key_0, _value_0 in pairs(b) do | |||
| 4613 | end | 4613 | end |
| 4614 | end | 4614 | end |
| 4615 | merge = _tab_0 | 4615 | merge = _tab_0 |
| 4616 | local source = { | ||
| 4617 | 1, | ||
| 4618 | 2, | ||
| 4619 | 3, | ||
| 4620 | name = "Yue" | ||
| 4621 | } | ||
| 4622 | local fullCopy | ||
| 4623 | do | ||
| 4624 | local _tab_0 = { } | ||
| 4625 | local _idx_0 = 1 | ||
| 4626 | for _key_0, _value_0 in pairs(source) do | ||
| 4627 | if _idx_0 == _key_0 then | ||
| 4628 | _tab_0[#_tab_0 + 1] = _value_0 | ||
| 4629 | _idx_0 = _idx_0 + 1 | ||
| 4630 | else | ||
| 4631 | _tab_0[_key_0] = _value_0 | ||
| 4632 | end | ||
| 4633 | end | ||
| 4634 | fullCopy = _tab_0 | ||
| 4635 | end | ||
| 4636 | local listCopy | ||
| 4637 | local _tab_0 = { } | ||
| 4638 | local _idx_0 = #_tab_0 + 1 | ||
| 4639 | for _index_0 = 1, #source do | ||
| 4640 | local _value_0 = source[_index_0] | ||
| 4641 | _tab_0[_idx_0] = _value_0 | ||
| 4642 | _idx_0 = _idx_0 + 1 | ||
| 4643 | end | ||
| 4644 | listCopy = _tab_0 | ||
| 4616 | local last | 4645 | local last |
| 4617 | do | 4646 | do |
| 4618 | local _item_0 = data.items | 4647 | local _item_0 = data.items |
| @@ -4906,6 +4935,35 @@ for _key_0, _value_0 in pairs(b) do | |||
| 4906 | end | 4935 | end |
| 4907 | end | 4936 | end |
| 4908 | merge = _tab_0 | 4937 | merge = _tab_0 |
| 4938 | local source = { | ||
| 4939 | 1, | ||
| 4940 | 2, | ||
| 4941 | 3, | ||
| 4942 | name = "Yue" | ||
| 4943 | } | ||
| 4944 | local fullCopy | ||
| 4945 | do | ||
| 4946 | local _tab_0 = { } | ||
| 4947 | local _idx_0 = 1 | ||
| 4948 | for _key_0, _value_0 in pairs(source) do | ||
| 4949 | if _idx_0 == _key_0 then | ||
| 4950 | _tab_0[#_tab_0 + 1] = _value_0 | ||
| 4951 | _idx_0 = _idx_0 + 1 | ||
| 4952 | else | ||
| 4953 | _tab_0[_key_0] = _value_0 | ||
| 4954 | end | ||
| 4955 | end | ||
| 4956 | fullCopy = _tab_0 | ||
| 4957 | end | ||
| 4958 | local listCopy | ||
| 4959 | local _tab_0 = { } | ||
| 4960 | local _idx_0 = #_tab_0 + 1 | ||
| 4961 | for _index_0 = 1, #source do | ||
| 4962 | local _value_0 = source[_index_0] | ||
| 4963 | _tab_0[_idx_0] = _value_0 | ||
| 4964 | _idx_0 = _idx_0 + 1 | ||
| 4965 | end | ||
| 4966 | listCopy = _tab_0 | ||
| 4909 | local last | 4967 | local last |
| 4910 | do | 4968 | do |
| 4911 | local _item_0 = data.items | 4969 | local _item_0 = data.items |
diff --git a/spec/outputs/codes_from_doc_zh.lua b/spec/outputs/codes_from_doc_zh.lua index 5849e00..cf08375 100644 --- a/spec/outputs/codes_from_doc_zh.lua +++ b/spec/outputs/codes_from_doc_zh.lua | |||
| @@ -4613,6 +4613,35 @@ for _key_0, _value_0 in pairs(b) do | |||
| 4613 | end | 4613 | end |
| 4614 | end | 4614 | end |
| 4615 | merge = _tab_0 | 4615 | merge = _tab_0 |
| 4616 | local source = { | ||
| 4617 | 1, | ||
| 4618 | 2, | ||
| 4619 | 3, | ||
| 4620 | name = "Yue" | ||
| 4621 | } | ||
| 4622 | local fullCopy | ||
| 4623 | do | ||
| 4624 | local _tab_0 = { } | ||
| 4625 | local _idx_0 = 1 | ||
| 4626 | for _key_0, _value_0 in pairs(source) do | ||
| 4627 | if _idx_0 == _key_0 then | ||
| 4628 | _tab_0[#_tab_0 + 1] = _value_0 | ||
| 4629 | _idx_0 = _idx_0 + 1 | ||
| 4630 | else | ||
| 4631 | _tab_0[_key_0] = _value_0 | ||
| 4632 | end | ||
| 4633 | end | ||
| 4634 | fullCopy = _tab_0 | ||
| 4635 | end | ||
| 4636 | local listCopy | ||
| 4637 | local _tab_0 = { } | ||
| 4638 | local _idx_0 = #_tab_0 + 1 | ||
| 4639 | for _index_0 = 1, #source do | ||
| 4640 | local _value_0 = source[_index_0] | ||
| 4641 | _tab_0[_idx_0] = _value_0 | ||
| 4642 | _idx_0 = _idx_0 + 1 | ||
| 4643 | end | ||
| 4644 | listCopy = _tab_0 | ||
| 4616 | local last | 4645 | local last |
| 4617 | do | 4646 | do |
| 4618 | local _item_0 = data.items | 4647 | local _item_0 = data.items |
| @@ -4906,6 +4935,35 @@ for _key_0, _value_0 in pairs(b) do | |||
| 4906 | end | 4935 | end |
| 4907 | end | 4936 | end |
| 4908 | merge = _tab_0 | 4937 | merge = _tab_0 |
| 4938 | local source = { | ||
| 4939 | 1, | ||
| 4940 | 2, | ||
| 4941 | 3, | ||
| 4942 | name = "Yue" | ||
| 4943 | } | ||
| 4944 | local fullCopy | ||
| 4945 | do | ||
| 4946 | local _tab_0 = { } | ||
| 4947 | local _idx_0 = 1 | ||
| 4948 | for _key_0, _value_0 in pairs(source) do | ||
| 4949 | if _idx_0 == _key_0 then | ||
| 4950 | _tab_0[#_tab_0 + 1] = _value_0 | ||
| 4951 | _idx_0 = _idx_0 + 1 | ||
| 4952 | else | ||
| 4953 | _tab_0[_key_0] = _value_0 | ||
| 4954 | end | ||
| 4955 | end | ||
| 4956 | fullCopy = _tab_0 | ||
| 4957 | end | ||
| 4958 | local listCopy | ||
| 4959 | local _tab_0 = { } | ||
| 4960 | local _idx_0 = #_tab_0 + 1 | ||
| 4961 | for _index_0 = 1, #source do | ||
| 4962 | local _value_0 = source[_index_0] | ||
| 4963 | _tab_0[_idx_0] = _value_0 | ||
| 4964 | _idx_0 = _idx_0 + 1 | ||
| 4965 | end | ||
| 4966 | listCopy = _tab_0 | ||
| 4909 | local last | 4967 | local last |
| 4910 | do | 4968 | do |
| 4911 | local _item_0 = data.items | 4969 | local _item_0 = data.items |
