You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced/language-extensions.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ foo, four = myFunc(nil)
63
63
64
64
## $range Iterator Function
65
65
66
-
Typescript's numeric for loops are less restrictive than Lua's, so they are transpiled into while loops instead. To create a Lua-style numeric for loop, you can use the `$range` language extension in a for...of loop.
66
+
TypeScript's numeric for loops are less restrictive than Lua's, so they are transpiled into while loops instead. To create a Lua-style numeric for loop, you can use the `$range` language extension in a for...of loop.
67
67
68
68
Example:
69
69
@@ -86,7 +86,7 @@ for i = 5, 1, -1 do end
86
86
87
87
## LuaIterable Type
88
88
89
-
Iterators in Lua work quite differently than in Typescript/Javscript, so a special type is needed to use them.
89
+
Iterators in Lua work quite differently than in TypeScript/JavaScript, so a special type is needed to use them.
90
90
91
91
For example, to declare and use a Lua function that returns an iterator for a set of strings, you can do this:
92
92
@@ -150,7 +150,7 @@ See the [Lua Reference Manual](https://www.lua.org/manual/5.3/manual.html#3.3.5)
150
150
151
151
## Operator Map Types
152
152
153
-
Lua supports overloading operators on types using [metatable methods](https://www.lua.org/manual/5.4/manual.html#2.4) such as `__add`. But, Javascript and Typescript do not support this. In order to use overloaded operators on types that support them, you can declare special mapping functions in TS that will translate to those operators in Lua.
153
+
Lua supports overloading operators on types using [metatable methods](https://www.lua.org/manual/5.4/manual.html#2.4) such as `__add`. But, JavaScript and TypeScript do not support this. In order to use overloaded operators on types that support them, you can declare special mapping functions in TS that will translate to those operators in Lua.
154
154
155
155
A common example of an overloaded operator is addition of a mathematical vector type:
156
156
@@ -230,7 +230,7 @@ You can also map functions to table accessors (`__index` and `__newindex`). See
230
230
231
231
## Lua Table Types
232
232
233
-
The `LuaTable` type is provided to allow direct creation and manipulation of Lua tables. This is useful if you want to use a table that uses types other than string for its keys, as that is not supported by Typescript. Calls to lua method tables are translated to simple lua:
233
+
The `LuaTable` type is provided to allow direct creation and manipulation of Lua tables. This is useful if you want to use a table that uses types other than string for its keys, as that is not supported by TypeScript. Calls to lua method tables are translated to simple lua:
234
234
235
235
-`table.get(key)` Get a value by key -> `table[key]`
236
236
-`table.set(key, value)` Set a value for key -> `table[key] = value`
@@ -370,7 +370,7 @@ There are more LuaTable functions other than `LuaTableGet` and `LuaTableSet` tha
370
370
371
371
## $vararg Constant
372
372
373
-
Lua allows use of the ellipsis operator (`...`) to access command line arguments passed when executing a script file. To access this from Typescript, you can use the `$vararg` constant in a spread expression.
373
+
Lua allows use of the ellipsis operator (`...`) to access command line arguments passed when executing a script file. To access this from TypeScript, you can use the `$vararg` constant in a spread expression.
0 commit comments