Fix the use of the term "Lua"

This commit is contained in:
Marcel Stör 2017-12-25 11:40:33 +01:00
parent bee404c358
commit e0f811dd2b
7 changed files with 15 additions and 15 deletions

View File

@ -150,7 +150,7 @@ Lists all files in the file system.
none none
#### Returns #### Returns
a lua table which contains the {file name: file size} pairs a Lua table which contains the {file name: file size} pairs
#### Example #### Example
```lua ```lua

View File

@ -112,14 +112,14 @@ Send an I²C stop condition.
[i2c.read()](#i2cread) [i2c.read()](#i2cread)
## i2c.write() ## i2c.write()
Write data to I²C bus. Data items can be multiple numbers, strings or lua tables. Write data to I²C bus. Data items can be multiple numbers, strings or Lua tables.
####Syntax ####Syntax
`i2c.write(id, data1[, data2[, ..., datan]])` `i2c.write(id, data1[, data2[, ..., datan]])`
####Parameters ####Parameters
- `id` always 0 - `id` always 0
- `data` data can be numbers, string or lua table. - `data` data can be numbers, string or Lua table.
#### Returns #### Returns
`number` number of bytes written `number` number of bytes written

View File

@ -245,7 +245,7 @@ Redirects the Lua interpreter output to a callback function. Optionally also pri
function tonet(str) function tonet(str)
sk:send(str) sk:send(str)
end end
node.output(tonet, 1) -- serial also get the lua output. node.output(tonet, 1) -- serial also get the Lua output.
``` ```
```lua ```lua

View File

@ -62,7 +62,7 @@ then call it asynchronously a few more times (e.g. using [node.task.post](../mod
#### Example #### Example
```lua ```lua
-- lua transmit radio code using protocol #1 -- Lua transmit radio code using protocol #1
-- pulse_length 300 microseconds -- pulse_length 300 microseconds
-- repeat 5 times -- repeat 5 times
-- use pin #7 (GPIO13) -- use pin #7 (GPIO13)

View File

@ -39,7 +39,7 @@ Puts the ESP8266 into deep sleep mode, like [`node.dsleep()`](node.md#nodedsleep
- The time slept will generally be considerably more accurate than with [`node.dsleep()`](node.md#nodedsleep). - The time slept will generally be considerably more accurate than with [`node.dsleep()`](node.md#nodedsleep).
- A sleep time of zero does not mean indefinite sleep, it is interpreted as a zero length sleep instead. - A sleep time of zero does not mean indefinite sleep, it is interpreted as a zero length sleep instead.
When the sleep timer expires, the platform is rebooted and the lua code is started with the `init.lua` file. The clock is set reasonably accurately. When the sleep timer expires, the platform is rebooted and the Lua code is started with the `init.lua` file. The clock is set reasonably accurately.
#### Syntax #### Syntax
`rtctime.dsleep(microseconds [, option])` `rtctime.dsleep(microseconds [, option])`

View File

@ -19,11 +19,11 @@ The handling of json null is as follows:
- Optionally, a single string can be specified in both the encoder and decoder. This string will be used in encoding/decoding to represent json null values. This string should not be used - Optionally, a single string can be specified in both the encoder and decoder. This string will be used in encoding/decoding to represent json null values. This string should not be used
anywhere else in your data structures. A suitable value might be `"\0"`. anywhere else in your data structures. A suitable value might be `"\0"`.
When encoding a lua object, if a function is found, then it is invoked (with no arguments) and the (single) returned value is encoded in the place of the function. When encoding a Lua object, if a function is found, then it is invoked (with no arguments) and the (single) returned value is encoded in the place of the function.
## sjson.encoder() ## sjson.encoder()
This creates an encoder object that can convert a LUA object into a JSON encoded string. This creates an encoder object that can convert a Lua object into a JSON encoded string.
####Syntax ####Syntax
`sjson.encoder(table [, opts])` `sjson.encoder(table [, opts])`
@ -101,7 +101,7 @@ end
## sjson.decoder() ## sjson.decoder()
This makes a decoder object that can parse a JSON encoded string into a lua object. A metatable can be specified for all the newly created lua tables. This allows This makes a decoder object that can parse a JSON encoded string into a Lua object. A metatable can be specified for all the newly created Lua tables. This allows
you to handle each value as it is inserted into each table (by implementing the `__newindex` method). you to handle each value as it is inserted into each table (by implementing the `__newindex` method).
####Syntax ####Syntax
@ -149,7 +149,7 @@ you only need the `download_url` keys, then the total size is around 600B. This
## sjson.decoder:write ## sjson.decoder:write
This provides more data to be parsed into the lua object. This provides more data to be parsed into the Lua object.
####Syntax ####Syntax
`decoder:write(string)` `decoder:write(string)`
@ -159,7 +159,7 @@ This provides more data to be parsed into the lua object.
- `string` the next piece of JSON encoded data - `string` the next piece of JSON encoded data
####Returns ####Returns
The constructed lua object or `nil` if the decode is not yet complete. The constructed Lua object or `nil` if the decode is not yet complete.
####Errors ####Errors
If a parse error occurrs during this decode, then an error is thrown and the parse is aborted. The object cannot be used again. If a parse error occurrs during this decode, then an error is thrown and the parse is aborted. The object cannot be used again.
@ -167,7 +167,7 @@ If a parse error occurrs during this decode, then an error is thrown and the par
## sjson.decoder:result ## sjson.decoder:result
This gets the decoded lua object, or raises an error if the decode is not yet complete. This can be called multiple times and will return the This gets the decoded Lua object, or raises an error if the decode is not yet complete. This can be called multiple times and will return the
same object each time. same object each time.
####Syntax ####Syntax
@ -230,5 +230,5 @@ for k,v in pairs(t) do print(k,v) end
##Constants ##Constants
There is one constant -- `sjson.NULL` -- which is used in lua structures to represent the presence of a JSON null. There is one constant -- `sjson.NULL` -- which is used in Lua structures to represent the presence of a JSON null.

View File

@ -62,7 +62,7 @@ ws = websocket.createClient()
ws:close() ws:close()
ws:close() -- nothing will happen ws:close() -- nothing will happen
ws = nil -- fully dispose the client as lua will now gc it ws = nil -- fully dispose the client as Lua will now gc it
``` ```
@ -137,7 +137,7 @@ ws:on("receive", function(_, msg, opcode)
end) end)
ws:on("close", function(_, status) ws:on("close", function(_, status)
print('connection closed', status) print('connection closed', status)
ws = nil -- required to lua gc the websocket client ws = nil -- required to Lua gc the websocket client
end) end)
ws:connect('ws://echo.websocket.org') ws:connect('ws://echo.websocket.org')