diff options
Diffstat (limited to 'src/Text/Pandoc/Lua/Module/Types.hs')
-rw-r--r-- | src/Text/Pandoc/Lua/Module/Types.hs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Lua/Module/Types.hs b/src/Text/Pandoc/Lua/Module/Types.hs new file mode 100644 index 000000000..641bde7d6 --- /dev/null +++ b/src/Text/Pandoc/Lua/Module/Types.hs @@ -0,0 +1,28 @@ +{- | + Module : Text.Pandoc.Lua.Module.Types + Copyright : © 2019 Albert Krewinkel + License : GNU GPL, version 2 or above + + Maintainer : Albert Krewinkel <tarleb+pandoc@moltkeplatz.de> + Stability : alpha + +Pandoc data type constructors. +-} +module Text.Pandoc.Lua.Module.Types + ( pushModule + ) where + +import Prelude +import Data.Version (Version) +import Foreign.Lua (Lua, NumResults) +import Text.Pandoc.Lua.Marshaling.Version () +import Text.Pandoc.Lua.Util (addFunction) + +import qualified Foreign.Lua as Lua + +-- | Push the pandoc.system module on the Lua stack. +pushModule :: Lua NumResults +pushModule = do + Lua.newtable + addFunction "Version" (return :: Version -> Lua Version) + return 1 |