diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-14 15:30:54 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-14 15:30:54 -0300 |
commit | b56d4e570a60a8e84df8288c3122eb5bb5c20af6 (patch) | |
tree | d5597a7865712fc407adbb41fe0749e728617ca7 /manual | |
parent | 9eca305e75010e30342486a4139846faf1b3eccb (diff) | |
download | lua-b56d4e570a60a8e84df8288c3122eb5bb5c20af6.tar.gz lua-b56d4e570a60a8e84df8288c3122eb5bb5c20af6.tar.bz2 lua-b56d4e570a60a8e84df8288c3122eb5bb5c20af6.zip |
Changes in the warning system
- The warning functions get an extra parameter that tells whether
message is to be continued (instead of using end-of-lines as a signal).
- The user data for the warning function is a regular value, instead
of a writable slot inside the Lua state.
Diffstat (limited to 'manual')
-rw-r--r-- | manual/manual.of | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/manual/manual.of b/manual/manual.of index b47fd865..63e78f95 100644 --- a/manual/manual.of +++ b/manual/manual.of | |||
@@ -4061,7 +4061,7 @@ If @id{index} @N{is 0}, then all stack elements are removed. | |||
4061 | 4061 | ||
4062 | Sets the @x{warning function} to be used by Lua to emit warnings | 4062 | Sets the @x{warning function} to be used by Lua to emit warnings |
4063 | @see{lua_WarnFunction}. | 4063 | @see{lua_WarnFunction}. |
4064 | The @id{ud} parameter initializes the slot @id{pud} passed to | 4064 | The @id{ud} parameter sets the value @id{ud} passed to |
4065 | the warning function. | 4065 | the warning function. |
4066 | 4066 | ||
4067 | } | 4067 | } |
@@ -4325,25 +4325,24 @@ Returns the version number of this core. | |||
4325 | } | 4325 | } |
4326 | 4326 | ||
4327 | @APIEntry{ | 4327 | @APIEntry{ |
4328 | typedef void (*lua_WarnFunction) (void **pud, const char *msg);| | 4328 | typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont);| |
4329 | 4329 | ||
4330 | The type of @x{warning function}s, called by Lua to emit warnings. | 4330 | The type of @x{warning function}s, called by Lua to emit warnings. |
4331 | The first parameter is the address of a writable slot, | 4331 | The first parameter is an opaque pointer |
4332 | constant for a given Lua state and | 4332 | set by @Lid{lua_setwarnf}. |
4333 | initialized by @Lid{lua_setwarnf}. | ||
4334 | The second parameter is the warning message. | 4333 | The second parameter is the warning message. |
4335 | This function should assume that | 4334 | The third parameter is a boolean that |
4336 | a message not ending with an end-of-line will be | 4335 | indicates whether the message is |
4337 | continued by the message in the next call. | 4336 | to be continued by the message in the next call. |
4338 | 4337 | ||
4339 | } | 4338 | } |
4340 | 4339 | ||
4341 | @APIEntry{ | 4340 | @APIEntry{ |
4342 | void lua_warning (lua_State *L, const char *msg);| | 4341 | void lua_warning (lua_State *L, const char *msg, int tocont);| |
4343 | @apii{0,0,-} | 4342 | @apii{0,0,-} |
4344 | 4343 | ||
4345 | Emits a warning with the given message. | 4344 | Emits a warning with the given message. |
4346 | A message not ending with an end-of-line should be | 4345 | A message in a call with @id{tocont} true should be |
4347 | continued in another call to this function. | 4346 | continued in another call to this function. |
4348 | 4347 | ||
4349 | } | 4348 | } |
@@ -6275,11 +6274,12 @@ The current value of this variable is @St{Lua 5.4}. | |||
6275 | 6274 | ||
6276 | } | 6275 | } |
6277 | 6276 | ||
6278 | @LibEntry{warn (message)| | 6277 | @LibEntry{warn (message [, tocont])| |
6279 | 6278 | ||
6280 | Emits a warning with the given message. | 6279 | Emits a warning with the given message. |
6281 | Note that messages not ending with an end-of-line | 6280 | A message in a call with @id{tocont} true should be |
6282 | are assumed to be continued by the message in the next call. | 6281 | continued in another call to this function. |
6282 | The default for @id{tocont} is false. | ||
6283 | 6283 | ||
6284 | } | 6284 | } |
6285 | 6285 | ||