Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ghc-lua for openSUSE:Factory checked in at 2023-04-14 13:13:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-lua (Old) and /work/SRC/openSUSE:Factory/.ghc-lua.new.19717 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-lua" Fri Apr 14 13:13:07 2023 rev:5 rq:1079196 version:2.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-lua/ghc-lua.changes 2023-04-04 21:21:24.737534007 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-lua.new.19717/ghc-lua.changes 2023-04-14 13:13:20.199652568 +0200 @@ -1,0 +2,34 @@ +Thu Apr 13 17:23:25 UTC 2023 - Peter Simons <[email protected]> + +- Update lua to version 2.3.1. + ## lua-2.3.1 + + Released 2023-03-17. + + - New module *Lua.Debug*: the module provides bindings to a + subset of functions of the Lua debug interface. Currently the + module only binds `lua_getupvalue` and `lua_setupvalue`. + + ## lua-2.3.0 + + Released 2023-03-13. + + - New function `hslua_setwarnf`: The function allows to set a + C function as a hook that is called on all complete warning + messages. It is intended as a simple way to set a custom + warning function. + + - Export version and copyright info from Lua.Constants: the + following patterns are made available, with content identical + to that of the respective C functions: `LUA_VERSION`, + `LUA_RELEASE`, and `LUA_COPYRIGHT`. + + - Added a new flag `cross-compile`. When enabled, the code is + setup in a way that allows cross-compilation of the package, + but some of the string constants will be hard-coded and may + not match the Lua version against which the library is + compiled. + + - `Type` is now an instance of `Read`. + +------------------------------------------------------------------- Old: ---- lua-2.2.1.tar.gz New: ---- lua-2.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-lua.spec ++++++ --- /var/tmp/diff_new_pack.Zls4fK/_old 2023-04-14 13:13:22.703666888 +0200 +++ /var/tmp/diff_new_pack.Zls4fK/_new 2023-04-14 13:13:22.707666911 +0200 @@ -20,7 +20,7 @@ %global pkgver %{pkg_name}-%{version} %bcond_with tests Name: ghc-%{pkg_name} -Version: 2.2.1 +Version: 2.3.1 Release: 0 Summary: Lua, an embeddable scripting language License: MIT ++++++ lua-2.2.1.tar.gz -> lua-2.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/CHANGELOG.md new/lua-2.3.1/CHANGELOG.md --- old/lua-2.2.1/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200 @@ -2,6 +2,36 @@ `lua` uses [PVP Versioning][]. +## lua-2.3.1 + +Released 2023-03-17. + +- New module *Lua.Debug*: the module provides bindings to a + subset of functions of the Lua debug interface. Currently the + module only binds `lua_getupvalue` and `lua_setupvalue`. + +## lua-2.3.0 + +Released 2023-03-13. + +- New function `hslua_setwarnf`: The function allows to set a + C function as a hook that is called on all complete warning + messages. It is intended as a simple way to set a custom + warning function. + +- Export version and copyright info from Lua.Constants: the + following patterns are made available, with content identical + to that of the respective C functions: `LUA_VERSION`, + `LUA_RELEASE`, and `LUA_COPYRIGHT`. + +- Added a new flag `cross-compile`. When enabled, the code is + setup in a way that allows cross-compilation of the package, + but some of the string constants will be hard-coded and may + not match the Lua version against which the library is + compiled. + +- `Type` is now an instance of `Read`. + ## lua-2.2.1 Released 2022-06-19. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/LICENSE new/lua-2.3.1/LICENSE --- old/lua-2.2.1/LICENSE 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/LICENSE 2001-09-09 03:46:40.000000000 +0200 @@ -1,7 +1,7 @@ Copyright © 1994-2022 Lua.org, PUC-Rio. Copyright © 2007-2012 Gracjan Polak Copyright © 2012-2015 Ãmer Sinan AÄacan -Copyright © 2016-2022 Albert Krewinkel +Copyright © 2016-2023 Albert Krewinkel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/README.md new/lua-2.3.1/README.md --- old/lua-2.2.1/README.md 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/README.md 2001-09-09 03:46:40.000000000 +0200 @@ -24,8 +24,8 @@ enable coders to embed the language into their programs, making them scriptable. -*Lua* ships with the official Lua interpreter, version 5.4.2. -Cabal flags allow to compile against a system-wide Lua +This package ships with the official Lua interpreter, version +5.4.4. Cabal flags allow to compile against a system-wide Lua installation instead, if desired. Build flags diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/cbits/hslua/hslwarn.c new/lua-2.3.1/cbits/hslua/hslwarn.c --- old/lua-2.2.1/cbits/hslua/hslwarn.c 1970-01-01 01:00:00.000000000 +0100 +++ new/lua-2.3.1/cbits/hslua/hslwarn.c 2001-09-09 03:46:40.000000000 +0200 @@ -0,0 +1,157 @@ +/* +** Large parts of the below code are adapted from the default warning +** functions defined in lauxlib.c. +** +** See Copyright Notice in lua.h +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "lua.h" +#include "lauxlib.h" + +#define HSLUA_RFLD_WARNF "HsLua warn hook" +#define HSLUA_RFLD_WARNINGS "HsLua warnings" + +/* print an error message */ +#if !defined(lua_writestringerror) +#define lua_writestringerror(s,p) \ + (fprintf(stderr, (s), (p)), fflush(stderr)) +#endif + +/* +** Initializes the warnings table. +*/ +static void reset_warnings (lua_State *L) { + lua_createtable(L, 1, 0); + lua_setfield(L, LUA_REGISTRYINDEX, HSLUA_RFLD_WARNINGS); +} + +/* +** Stores the warning in the registry. +*/ +static void store_warning (lua_State *L, const char *message) { + if (lua_getfield(L, LUA_REGISTRYINDEX, HSLUA_RFLD_WARNINGS) != LUA_TTABLE) { + return; + } + lua_pushstring(L, message); + lua_seti(L, -2, luaL_len(L, -2) + 1); /* append message */ + lua_pop(L, 1); /* messages table */ +} + +/* Concatenates all collected warnings and pushes the result to the stack. */ +static void pushwarning (lua_State *L) { + if (lua_getfield(L, LUA_REGISTRYINDEX, HSLUA_RFLD_WARNINGS) != LUA_TTABLE) { + lua_pushliteral(L, ""); + return; + } + + int tblidx = lua_absindex(L, -1); + lua_Integer last = luaL_len(L, tblidx); + luaL_Buffer b; + luaL_buffinit(L, &b); + for (int i = 1; i <= last; i++) { + if (lua_geti(L, tblidx, i) != LUA_TSTRING) { + /* not a string; skip it silently */ + lua_pop(L, 1); + } else { + luaL_addvalue(&b); + } + } + lua_remove(L, -2); /* warnings table */ + luaL_pushresult(&b); +} + +static void call_warn_hook (lua_State *L) { + if (lua_getfield(L, LUA_REGISTRYINDEX, HSLUA_RFLD_WARNF) == LUA_TFUNCTION) { + pushwarning(L); + lua_call(L, 1, 0); + } +} + +/* +** Warning functions: +** warnfoff: warning system is off +** warnfon: ready to start a new message +** warnfcont: previous message is to be continued +*/ +static void warnfoff (void *ud, const char *message, int tocont); +static void warnfon (void *ud, const char *message, int tocont); +static void warnfcont (void *ud, const char *message, int tocont); + +/* +** Check whether message is a control message. If so, execute the +** control or ignore it if unknown. +*/ +static int checkcontrol (lua_State *L, const char *message, int tocont) { + if (tocont || *(message++) != '@') /* not a control message? */ + return 0; + else { + if (strcmp(message, "off") == 0) + lua_setwarnf(L, warnfoff, L); /* turn warnings off */ + else if (strcmp(message, "on") == 0) + lua_setwarnf(L, warnfon, L); /* turn warnings on */ + return 1; /* it was a control message */ + } +} + +/* +** Does not write the warning to stderr, but still records the message +** so it can be processed by the custom hook. +*/ +static void warnfoff (void *ud, const char *message, int tocont) { + lua_State *L = (lua_State *)ud; + if (checkcontrol(L, message, tocont)) { + return; /* nothing else to be done */ + } + store_warning(L, message); + if (!tocont) { /* last part */ + call_warn_hook(L); /* call the warnings hook */ + reset_warnings(L); /* reset warnings table */ + } +} + + +/* +** Writes the message and handle 'tocont', finishing the message +** if needed and setting the next warn function. +*/ +static void warnfcont (void *ud, const char *message, int tocont) { + lua_State *L = (lua_State *)ud; + lua_writestringerror("%s", message); /* write message */ + store_warning(L, message); + if (tocont) /* not the last part? */ + lua_setwarnf(L, warnfcont, L); /* to be continued */ + else { /* last part */ + lua_writestringerror("%s", "\n"); /* finish message with end-of-line */ + lua_setwarnf(L, warnfon, L); /* next call is a new message */ + call_warn_hook(L); /* call the warnings hook */ + reset_warnings(L); /* reset warnings table */ + } +} + +/* +** Records a warning, and writes a warning prefix followed by the +** warning to stderr. +*/ +static void warnfon (void *ud, const char *message, int tocont) { + lua_State *L = (lua_State *)ud; + if (checkcontrol(L, message, tocont)) /* control message? */ + return; /* nothing else to be done */ + lua_writestringerror("%s", "Lua warning: "); /* start a new warning */ + warnfcont(ud, message, tocont); /* finish processing */ +} + + +/* +** Sets the object at the top of the stack as the function that is +** called on the concatenated warning messages. Pops the function from +** the stack. +*/ +void hsluaL_setwarnf (lua_State *L) { + lua_setfield(L, LUA_REGISTRYINDEX, HSLUA_RFLD_WARNF); + reset_warnings(L); + lua_setwarnf(L, warnfoff, L); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/lua.cabal new/lua-2.3.1/lua.cabal --- old/lua-2.2.1/lua.cabal 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/lua.cabal 2001-09-09 03:46:40.000000000 +0200 @@ -1,6 +1,6 @@ cabal-version: 2.2 name: lua -version: 2.2.1 +version: 2.3.1 synopsis: Lua, an embeddable scripting language description: This package provides bindings and types to bridge Haskell and <https://www.lua.org/ Lua>. @@ -13,24 +13,23 @@ license: MIT license-file: LICENSE author: Albert Krewinkel -maintainer: Albert Krewinkel <[email protected]> +maintainer: Albert Krewinkel <[email protected]> copyright: © 2007â2012 Gracjan Polak; © 2012â2016 Ãmer Sinan AÄacan; - © 2017-2022 Albert Krewinkel + © 2017-2023 Albert Krewinkel category: Foreign build-type: Simple extra-source-files: cbits/lua-5.4.4/*.h , cbits/hslua/*.h , README.md , CHANGELOG.md -tested-with: GHC == 8.0.2 - , GHC == 8.2.2 - , GHC == 8.4.4 +tested-with: GHC == 8.4.4 , GHC == 8.6.5 , GHC == 8.8.4 , GHC == 8.10.7 , GHC == 9.0.2 - , GHC == 9.2.3 + , GHC == 9.2.5 + , GHC == 9.4.4 source-repository head type: git @@ -75,9 +74,16 @@ description: Use @pkg-config@ to discover library and include paths. Setting this flag implies `system-lua`. +flag cross-compile + default: False + manual: True + description: Avoids constructs that would prevent cross-compilation. + The Lua version constants may become inaccurate when + this flag is enabled. + common common-options default-language: Haskell2010 - build-depends: base >= 4.8 && < 5 + build-depends: base >= 4.11 && < 5 ghc-options: -Wall -Wincomplete-record-updates -Wnoncanonical-monad-instances @@ -100,12 +106,16 @@ if flag(allow-unsafe-gc) cpp-options: -DALLOW_UNSAFE_GC + if flag(cross-compile) + cpp-options: -D_LUA_NO_CONST_STR + library import: common-options exposed-modules: Lua , Lua.Auxiliary , Lua.Call , Lua.Constants + , Lua.Debug , Lua.Ersatz , Lua.Ersatz.Auxiliary , Lua.Ersatz.Functions @@ -113,6 +123,7 @@ , Lua.Primary , Lua.Types , Lua.Userdata + , Lua.Warn hs-source-dirs: src default-extensions: CApiFFI , ForeignFunctionInterface @@ -126,6 +137,7 @@ , cbits/hslua/hslcall.c , cbits/hslua/hslauxlib.c , cbits/hslua/hslua.c + , cbits/hslua/hslwarn.c include-dirs: cbits/hslua includes: lua.h , luaconf.h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Auxiliary.hs new/lua-2.3.1/src/Lua/Auxiliary.hs --- old/lua-2.2.1/src/Lua/Auxiliary.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/src/Lua/Auxiliary.hs 2001-09-09 03:46:40.000000000 +0200 @@ -3,9 +3,9 @@ Module : Lua.Auxiliary Copyright : © 2007â2012 Gracjan Polak; © 2012â2016 Ãmer Sinan AÄacan; - © 2017-2022 Albert Krewinkel + © 2017-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Portability : non-portable (depends on GHC) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Call.hs new/lua-2.3.1/src/Lua/Call.hs --- old/lua-2.2.1/src/Lua/Call.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/src/Lua/Call.hs 2001-09-09 03:46:40.000000000 +0200 @@ -3,9 +3,9 @@ Module : Lua.Call Copyright : © 2007â2012 Gracjan Polak; © 2012â2016 Ãmer Sinan AÄacan; - © 2017-2022 Albert Krewinkel + © 2017-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Portability : non-portable (depends on GHC) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Constants.hsc new/lua-2.3.1/src/Lua/Constants.hsc --- old/lua-2.2.1/src/Lua/Constants.hsc 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/src/Lua/Constants.hsc 2001-09-09 03:46:40.000000000 +0200 @@ -3,17 +3,21 @@ Module : Lua.Constants Copyright : © 2007â2012 Gracjan Polak; © 2012â2016 Ãmer Sinan AÄacan; - © 2017-2022 Albert Krewinkel + © 2017-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Portability : ForeignFunctionInterface Lua constants -} module Lua.Constants - ( -- * Special values - pattern LUA_MULTRET + ( -- * Version and copyright information + pattern LUA_VERSION + , pattern LUA_RELEASE + , pattern LUA_COPYRIGHT + -- * Special values + , pattern LUA_MULTRET -- * Pseudo-indices , pattern LUA_REGISTRYINDEX -- * Basic types @@ -81,6 +85,29 @@ #include <lauxlib.h> -- +-- Version and copyright info +-- + +-- | Lua version information in the form "@Lua MAJOR.MINOR@". +pattern LUA_VERSION :: String + +-- | Lua version information in the form "@Lua MAJOR.MINOR.RELEASE@". +pattern LUA_RELEASE :: String + +-- | Lua copyright information; includes the Lua release +pattern LUA_COPYRIGHT :: String + +#ifdef _LUA_NO_CONST_STR +pattern LUA_VERSION = "Lua 5.4" +pattern LUA_RELEASE = "Lua 5.4.4" +pattern LUA_COPYRIGHT = "Lua 5.4.4 Copyright (C) 1994-2022 Lua.org, PUC-Rio" +#else +pattern LUA_RELEASE = #{const_str LUA_RELEASE} +pattern LUA_VERSION = #{const_str LUA_VERSION} +pattern LUA_COPYRIGHT = #{const_str LUA_COPYRIGHT} +#endif + +-- -- Special values -- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Debug.hs new/lua-2.3.1/src/Lua/Debug.hs --- old/lua-2.2.1/src/Lua/Debug.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/lua-2.3.1/src/Lua/Debug.hs 2001-09-09 03:46:40.000000000 +0200 @@ -0,0 +1,53 @@ +{-| +Module : Lua.Debug +Copyright : © 2023 Albert Krewinkel +License : MIT +Maintainer : Albert Krewinkel <[email protected]> + +Haskell bindings to Lua's debug interface. +-} +module Lua.Debug + ( lua_getupvalue + , lua_setupvalue + ) +where + +import Foreign.C +import Lua.Types as Lua + +-- | Gets information about the @n@-th upvalue of the closure at index +-- @funcindex@. It pushes the upvalue\'s value onto the stack and +-- returns its name. Returns @NULL@ (and pushes nothing) when the index +-- @n@ is greater than the number of upvalues. +-- +-- See +-- <https://www.lua.org/manual/5.4/manual.html#pdf-debug.getupvalue debug.getupvalue> +-- for more information about upvalues. +-- +-- @[0, +(0|1), -]@ +-- +-- <https://www.lua.org/manual/5.4/manual.html#lua_getupvalue lua_getupvalue>. +foreign import ccall unsafe "lua.h lua_getupvalue" + lua_getupvalue :: Lua.State + -> StackIndex -- ^ funcindex + -> CInt -- ^ n + -> IO CString + +-- | Sets the value of a closureâs upvalue. It assigns the value on the +-- top of the stack to the upvalue and returns its name. It also pops +-- the value from the stack. +-- +-- Returns @NULL@ (and pops nothing) when the index @n@ is greater than +-- the number of upvalues. +-- +-- Parameters @funcindex@ and @n@ are as in the function +-- 'lua_getupvalue'. +-- +-- @[-(0|1), +0, -]@ +-- +-- <https://www.lua.org/manual/5.4/manual.html#lua_setupvalue lua_setupvalue>. +foreign import ccall unsafe "lua.h lua_setupvalue" + lua_setupvalue :: Lua.State + -> StackIndex -- ^ funcindex + -> CInt -- ^ n + -> IO CString diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Ersatz/Auxiliary.hs new/lua-2.3.1/src/Lua/Ersatz/Auxiliary.hs --- old/lua-2.2.1/src/Lua/Ersatz/Auxiliary.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/src/Lua/Ersatz/Auxiliary.hs 2001-09-09 03:46:40.000000000 +0200 @@ -2,9 +2,9 @@ Module : Lua.Ersatz.Auxiliary Copyright : © 2007â2012 Gracjan Polak; © 2012â2016 Ãmer Sinan AÄacan; - © 2017-2022 Albert Krewinkel + © 2017-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Portability : non-portable (depends on GHC) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Ersatz/Functions.hs new/lua-2.3.1/src/Lua/Ersatz/Functions.hs --- old/lua-2.2.1/src/Lua/Ersatz/Functions.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/src/Lua/Ersatz/Functions.hs 2001-09-09 03:46:40.000000000 +0200 @@ -3,9 +3,9 @@ Module : Lua.Ersatz.Functions Copyright : © 2007â2012 Gracjan Polak; © 2012â2016 Ãmer Sinan AÄacan; - © 2017-2022 Albert Krewinkel + © 2017-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Portability : ForeignFunctionInterface, CPP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Ersatz.hs new/lua-2.3.1/src/Lua/Ersatz.hs --- old/lua-2.2.1/src/Lua/Ersatz.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/src/Lua/Ersatz.hs 2001-09-09 03:46:40.000000000 +0200 @@ -2,9 +2,9 @@ Module : Lua.Ersatz Copyright : © 2007â2012 Gracjan Polak; © 2012â2016 Ãmer Sinan AÄacan; - © 2017-2022 Albert Krewinkel + © 2017-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Ersatz functions for Lua API items which may, directly or indirectly, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Lib.hs new/lua-2.3.1/src/Lua/Lib.hs --- old/lua-2.2.1/src/Lua/Lib.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/src/Lua/Lib.hs 2001-09-09 03:46:40.000000000 +0200 @@ -2,9 +2,9 @@ Module : Lua.Lib Copyright : © 2007â2012 Gracjan Polak; © 2012â2016 Ãmer Sinan AÄacan; - © 2017-2022 Albert Krewinkel + © 2017-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Portability : ForeignFunctionInterface, CPP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Primary.hs new/lua-2.3.1/src/Lua/Primary.hs --- old/lua-2.2.1/src/Lua/Primary.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/src/Lua/Primary.hs 2001-09-09 03:46:40.000000000 +0200 @@ -3,9 +3,9 @@ Module : Lua.Primary Copyright : © 2007â2012 Gracjan Polak; © 2012â2016 Ãmer Sinan AÄacan; - © 2017-2022 Albert Krewinkel + © 2017-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Portability : ForeignFunctionInterface, CPP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Types.hsc new/lua-2.3.1/src/Lua/Types.hsc --- old/lua-2.2.1/src/Lua/Types.hsc 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/src/Lua/Types.hsc 2001-09-09 03:46:40.000000000 +0200 @@ -5,9 +5,9 @@ Module : Lua.Types Copyright : © 2007â2012 Gracjan Polak; © 2012â2016 Ãmer Sinan AÄacan; - © 2017-2022 Albert Krewinkel + © 2017-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Portability : non-portable (depends on GHC) @@ -20,6 +20,7 @@ , CFunction , PreCFunction , WarnFunction + , PreWarnFunction , LuaBool (..) , Integer (..) , Number (..) @@ -101,6 +102,12 @@ -- more details about warnings. type WarnFunction = FunPtr (Ptr () -> CString -> LuaBool -> IO ()) +-- | Type of Haskell functions that can be turned into a WarnFunction. +-- +-- This is the same as a dereferenced 'WarnFunction'. +type PreWarnFunction = Ptr () -> CString -> LuaBool -> IO () + + -- | The type of integers in Lua. -- -- By default this type is @'Int64'@, but that can be changed to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Userdata.hs new/lua-2.3.1/src/Lua/Userdata.hs --- old/lua-2.2.1/src/Lua/Userdata.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/src/Lua/Userdata.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,9 +1,9 @@ {-# LANGUAGE CPP #-} {-| Module : Lua.Userdata -Copyright : © 2017-2022 Albert Krewinkel +Copyright : © 2017-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Portability : ForeignFunctionInterface diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua/Warn.hs new/lua-2.3.1/src/Lua/Warn.hs --- old/lua-2.2.1/src/Lua/Warn.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/lua-2.3.1/src/Lua/Warn.hs 2001-09-09 03:46:40.000000000 +0200 @@ -0,0 +1,28 @@ +{-# LANGUAGE CPP #-} +{-| +Module : Lua.Warn +Copyright : © 2023 Albert Krewinkel +License : MIT +Maintainer : Albert Krewinkel <[email protected]> + +Simpler interface to the Lua warnings system. +-} +module Lua.Warn + ( hsluaL_setwarnf + ) where + +import Lua.Types (State (State)) + +-- | Sets a warning function. This is a simplified version of +-- 'Lua.Primary.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. +foreign import ccall "hslwarn.c hsluaL_setwarnf" + hsluaL_setwarnf :: State -> IO () diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/src/Lua.hs new/lua-2.3.1/src/Lua.hs --- old/lua-2.2.1/src/Lua.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/src/Lua.hs 2001-09-09 03:46:40.000000000 +0200 @@ -2,9 +2,9 @@ {-# LANGUAGE PatternSynonyms #-} {-| Module : Lua -Copyright : © 2021-2022 Albert Krewinkel +Copyright : © 2021-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Portability : portable @@ -225,6 +225,10 @@ , fromReference , toReference + -- * Debug interface + , lua_getupvalue + , lua_setupvalue + -- * Ersatz functions , hsluaL_newstate , hsluaL_tolstring @@ -241,6 +245,8 @@ , hslua_concat , hslua_arith , hslua_compare + -- ** Simplified warnings handling + , hsluaL_setwarnf -- * Standard Lua libraries , luaopen_base @@ -254,17 +260,24 @@ -- * Push Haskell functions , hslua_pushhsfunction + + -- * Version and copyright info + , pattern LUA_VERSION + , pattern LUA_RELEASE + , pattern LUA_COPYRIGHT ) where import Foreign.C (CInt) import Lua.Auxiliary import Lua.Call import Lua.Constants +import Lua.Debug import Lua.Ersatz.Functions import Lua.Ersatz.Auxiliary import Lua.Lib import Lua.Primary import Lua.Types as Lua +import Lua.Warn -- | Runs operations on a new Lua @'Lua.State'@. The state is created -- when the function is called and closed on return. The state, and all diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/test/Lua/ErsatzTests.hs new/lua-2.3.1/test/Lua/ErsatzTests.hs --- old/lua-2.2.1/test/Lua/ErsatzTests.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/test/Lua/ErsatzTests.hs 2001-09-09 03:46:40.000000000 +0200 @@ -1,8 +1,8 @@ {-| Module : Lua.ErsatzTests -Copyright : © 2021-2022 Albert Krewinkel +Copyright : © 2021-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Tests for Lua bindings. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/test/Lua/PrimaryTests.hs new/lua-2.3.1/test/Lua/PrimaryTests.hs --- old/lua-2.2.1/test/Lua/PrimaryTests.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/test/Lua/PrimaryTests.hs 2001-09-09 03:46:40.000000000 +0200 @@ -2,9 +2,9 @@ {-# OPTIONS_GHC -Wno-unused-do-bind #-} {-| Module : Lua.PrimaryTests -Copyright : © 2021-2022 Albert Krewinkel +Copyright : © 2021-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Tests for bindings to primary API functions. -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/test/Lua/UnsafeTests.hs new/lua-2.3.1/test/Lua/UnsafeTests.hs --- old/lua-2.2.1/test/Lua/UnsafeTests.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/test/Lua/UnsafeTests.hs 2001-09-09 03:46:40.000000000 +0200 @@ -2,9 +2,9 @@ {-# OPTIONS_GHC -Wno-unused-do-bind #-} {-| Module : Lua.UnsafeTests -Copyright : © 2021-2022 Albert Krewinkel +Copyright : © 2021-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Tests for bindings to unsafe functions. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-2.2.1/test/test-lua.hs new/lua-2.3.1/test/test-lua.hs --- old/lua-2.2.1/test/test-lua.hs 2001-09-09 03:46:40.000000000 +0200 +++ new/lua-2.3.1/test/test-lua.hs 2001-09-09 03:46:40.000000000 +0200 @@ -2,9 +2,9 @@ {-# LANGUAGE CPP #-} {-| Module : Main -Copyright : © 2021-2022 Albert Krewinkel +Copyright : © 2021-2023 Albert Krewinkel License : MIT -Maintainer : Albert Krewinkel <[email protected]> +Maintainer : Albert Krewinkel <[email protected]> Stability : beta Tests for the raw Lua bindings. @@ -191,6 +191,8 @@ ("_LOADED" @=? loadedTableRegistryField) , "preloadTableRegistryField" =: ("_PRELOAD" @=? preloadTableRegistryField) + , "LUA_VERSION" =: + ("Lua 5.4" @=? LUA_VERSION) ] , testGroup "compare"
