@tilua/parser 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/dist/index.cjs +310 -208
- package/dist/index.d.cts +15 -11
- package/dist/index.d.ts +15 -11
- package/dist/index.js +310 -208
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -593,9 +593,17 @@ An array is a table, at runtime as much as in the types: `return [a, b]` is
|
|
|
593
593
|
a Roblox method such as `FindPartOnRay` — the type library puts a function of
|
|
594
594
|
its own in place of that global or method, which answers one value, as its
|
|
595
595
|
type says. A tuple may end in a rest,
|
|
596
|
-
`[string, ...number[]]`: that many, then any number more.
|
|
597
|
-
|
|
598
|
-
and
|
|
596
|
+
`[string, ...number[]]`: that many, then any number more.
|
|
597
|
+
|
|
598
|
+
A declaration and an assignment take one value, and a call is one value
|
|
599
|
+
wherever it is written — an argument, a `return`. Luau's `local a, b = 1, 2`
|
|
600
|
+
is an error that says to write `const [a, b] = [1, 2]`. Where a Luau function
|
|
601
|
+
answers several values and nothing gathers them, ask for all of them by making
|
|
602
|
+
the call an array's last element:
|
|
603
|
+
|
|
604
|
+
```luau
|
|
605
|
+
const [a, b] = [require(module)] -- { require(module) }: every value
|
|
606
|
+
```
|
|
599
607
|
|
|
600
608
|
**A loop takes one value too** — `for (const item in source)`, and several are
|
|
601
609
|
an array the pattern takes apart:
|