diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-10-19 16:30:39 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-10-19 16:30:39 -0300 |
| commit | c954db39241a8b21d7b32b42b87a066b4708f969 (patch) | |
| tree | 7cae63de60ef7f3ca5f56a97a98121b8607b2f59 | |
| parent | 14d2803e55f0bbc2b09890a3b30afbb063ec973d (diff) | |
| download | lua-c954db39241a8b21d7b32b42b87a066b4708f969.tar.gz lua-c954db39241a8b21d7b32b42b87a066b4708f969.tar.bz2 lua-c954db39241a8b21d7b32b42b87a066b4708f969.zip | |
Option '-l g=mod' added to the manual
Plus some other improvements in the manual.
| -rw-r--r-- | manual/manual.of | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/manual/manual.of b/manual/manual.of index ade47b20..10c16bd1 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
| @@ -1423,9 +1423,6 @@ A label should not be declared | |||
| 1423 | where a label with the same name is visible, | 1423 | where a label with the same name is visible, |
| 1424 | even if this other label has been declared in an enclosing block. | 1424 | even if this other label has been declared in an enclosing block. |
| 1425 | 1425 | ||
| 1426 | Labels and empty statements are called @def{void statements}, | ||
| 1427 | as they perform no actions. | ||
| 1428 | |||
| 1429 | The @Rw{break} statement terminates the execution of a | 1426 | The @Rw{break} statement terminates the execution of a |
| 1430 | @Rw{while}, @Rw{repeat}, or @Rw{for} loop, | 1427 | @Rw{while}, @Rw{repeat}, or @Rw{for} loop, |
| 1431 | skipping to the next statement after the loop: | 1428 | skipping to the next statement after the loop: |
| @@ -2361,6 +2358,7 @@ Lua is a lexically scoped language. | |||
| 2361 | The scope of a local variable begins at the first statement after | 2358 | The scope of a local variable begins at the first statement after |
| 2362 | its declaration and lasts until the last non-void statement | 2359 | its declaration and lasts until the last non-void statement |
| 2363 | of the innermost block that includes the declaration. | 2360 | of the innermost block that includes the declaration. |
| 2361 | (@emph{Void statements} are labels and empty statements.) | ||
| 2364 | Consider the following example: | 2362 | Consider the following example: |
| 2365 | @verbatim{ | 2363 | @verbatim{ |
| 2366 | x = 10 -- global variable | 2364 | x = 10 -- global variable |
| @@ -3165,8 +3163,7 @@ The index must be the last index previously marked to be closed | |||
| 3165 | A @idx{__close} metamethod cannot yield | 3163 | A @idx{__close} metamethod cannot yield |
| 3166 | when called through this function. | 3164 | when called through this function. |
| 3167 | 3165 | ||
| 3168 | (Exceptionally, this function was introduced in release 5.4.3. | 3166 | (This function was introduced in @N{release 5.4.3}.) |
| 3169 | It is not present in previous 5.4 releases.) | ||
| 3170 | 3167 | ||
| 3171 | } | 3168 | } |
| 3172 | 3169 | ||
| @@ -3713,7 +3710,7 @@ Pops a key from the stack, | |||
| 3713 | and pushes a key@En{}value pair from the table at the given index, | 3710 | and pushes a key@En{}value pair from the table at the given index, |
| 3714 | the @Q{next} pair after the given key. | 3711 | the @Q{next} pair after the given key. |
| 3715 | If there are no more elements in the table, | 3712 | If there are no more elements in the table, |
| 3716 | then @Lid{lua_next} returns 0 and pushes nothing. | 3713 | then @Lid{lua_next} @N{returns 0} and pushes nothing. |
| 3717 | 3714 | ||
| 3718 | A typical table traversal looks like this: | 3715 | A typical table traversal looks like this: |
| 3719 | @verbatim{ | 3716 | @verbatim{ |
| @@ -5539,8 +5536,8 @@ It is defined as the following macro: | |||
| 5539 | @verbatim{ | 5536 | @verbatim{ |
| 5540 | (luaL_loadfile(L, filename) || lua_pcall(L, 0, LUA_MULTRET, 0)) | 5537 | (luaL_loadfile(L, filename) || lua_pcall(L, 0, LUA_MULTRET, 0)) |
| 5541 | } | 5538 | } |
| 5542 | It returns @Lid{LUA_OK} if there are no errors, | 5539 | It @N{returns 0} (@Lid{LUA_OK}) if there are no errors, |
| 5543 | or an error code in case of errors @see{statuscodes}. | 5540 | or 1 in case of errors. |
| 5544 | 5541 | ||
| 5545 | } | 5542 | } |
| 5546 | 5543 | ||
| @@ -5552,8 +5549,8 @@ It is defined as the following macro: | |||
| 5552 | @verbatim{ | 5549 | @verbatim{ |
| 5553 | (luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0)) | 5550 | (luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0)) |
| 5554 | } | 5551 | } |
| 5555 | It returns @Lid{LUA_OK} if there are no errors, | 5552 | It @N{returns 0} (@Lid{LUA_OK}) if there are no errors, |
| 5556 | or an error code in case of errors @see{statuscodes}. | 5553 | or 1 in case of errors. |
| 5557 | 5554 | ||
| 5558 | } | 5555 | } |
| 5559 | 5556 | ||
| @@ -8577,7 +8574,7 @@ the returned status is this number. | |||
| 8577 | The default value for @id{code} is @true. | 8574 | The default value for @id{code} is @true. |
| 8578 | 8575 | ||
| 8579 | If the optional second argument @id{close} is true, | 8576 | If the optional second argument @id{close} is true, |
| 8580 | closes the Lua state before exiting. | 8577 | the function closes the Lua state before exiting @seeF{lua_close}. |
| 8581 | 8578 | ||
| 8582 | } | 8579 | } |
| 8583 | 8580 | ||
| @@ -8985,12 +8982,16 @@ The options are: | |||
| 8985 | @item{@T{-i}| enter interactive mode after running @rep{script};} | 8982 | @item{@T{-i}| enter interactive mode after running @rep{script};} |
| 8986 | @item{@T{-l @rep{mod}}| @Q{require} @rep{mod} and assign the | 8983 | @item{@T{-l @rep{mod}}| @Q{require} @rep{mod} and assign the |
| 8987 | result to global @rep{mod};} | 8984 | result to global @rep{mod};} |
| 8985 | @item{@T{-l @rep{g=mod}}| @Q{require} @rep{mod} and assign the | ||
| 8986 | result to global @rep{g};} | ||
| 8988 | @item{@T{-v}| print version information;} | 8987 | @item{@T{-v}| print version information;} |
| 8989 | @item{@T{-E}| ignore environment variables;} | 8988 | @item{@T{-E}| ignore environment variables;} |
| 8990 | @item{@T{-W}| turn warnings on;} | 8989 | @item{@T{-W}| turn warnings on;} |
| 8991 | @item{@T{--}| stop handling options;} | 8990 | @item{@T{--}| stop handling options;} |
| 8992 | @item{@T{-}| execute @id{stdin} as a file and stop handling options.} | 8991 | @item{@T{-}| execute @id{stdin} as a file and stop handling options.} |
| 8993 | } | 8992 | } |
| 8993 | (The form @T{-l @rep{g=mod}} was introduced in @N{release 5.4.4}.) | ||
| 8994 | |||
| 8994 | After handling its options, @id{lua} runs the given @emph{script}. | 8995 | After handling its options, @id{lua} runs the given @emph{script}. |
| 8995 | When called without arguments, | 8996 | When called without arguments, |
| 8996 | @id{lua} behaves as @T{lua -v -i} | 8997 | @id{lua} behaves as @T{lua -v -i} |
