Lua.Warn

lua-2.3.3: Lua, an embeddable scripting language

Copyright | © 2023-2024 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <tarleb@hslua.org>
Safe Haskell | None
Language | Haskell2010

Lua.Warn

Description

Simpler interface to the Lua warnings system.

Synopsis

- hsluaL_setwarnf :: State -> IO ()

# Documentation

hsluaL_setwarnf :: State -> IO () #

Sets a warning function. This is a simplified version of `lua_setwarnf`. The function at the top of the stack is set as the "warning hook", i.e., it is called with the concatenated warning components as the single argument.

The hook function is popped of the stack.

The control messages `@on` and `@off` are still supported; as with the default warning function, these commands can switch error reporting to stderr on and off. The given Haskell function will be called in either case, even when the error is not written to stderr.