@@ -0,0 +1,40 @@
1+{-
2+Copyright © 2017 Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
3+
4+This program is free software; you can redistribute it and/or modify
5+it under the terms of the GNU General Public License as published by
6+the Free Software Foundation; either version 2 of the License, or
7+(at your option) any later version.
8+
9+This program is distributed in the hope that it will be useful,
10+but WITHOUT ANY WARRANTY; without even the implied warranty of
11+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+GNU General Public License for more details.
13+
14+You should have received a copy of the GNU General Public License
15+along with this program; if not, write to the Free Software
16+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17+-}
18+{-# LANGUAGE CPP #-}
19+{- |
20+ Module : Text.Pandoc.Lua.Compat
21+ Copyright : Copyright © 2017 Albert Krewinkel
22+ License : GNU GPL, version 2 or above
23+
24+ Maintainer : Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
25+ Stability : alpha
26+
27+Compatibility helpers for hslua
28+-}
29+module Text.Pandoc.Lua.Compat ( loadstring ) where
30+
31+import Scripting.Lua ( LuaState )
32+import qualified Scripting.Lua as Lua
33+
34+-- | Interpret string as lua code and load into the lua environment.
35+loadstring :: LuaState -> String -> String -> IO Int
36+#if MIN_VERSION_hslua(0,5,0)
37+loadstring lua script _ = Lua.loadstring lua script
38+#else
39+loadstring lua script cn = Lua.loadstring lua script cn
40+#endif