aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Filter/Lua.hs4
-rw-r--r--src/Text/Pandoc/Lua.hs4
-rw-r--r--src/Text/Pandoc/Lua/Init.hs6
-rw-r--r--src/Text/Pandoc/Writers/Custom.hs4
4 files changed, 9 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Filter/Lua.hs b/src/Text/Pandoc/Filter/Lua.hs
index 6c78bef06..48aa66834 100644
--- a/src/Text/Pandoc/Filter/Lua.hs
+++ b/src/Text/Pandoc/Filter/Lua.hs
@@ -38,7 +38,7 @@ import Text.Pandoc.Class (PandocIO)
import Text.Pandoc.Definition (Pandoc)
import Text.Pandoc.Error (PandocError (PandocFilterError))
import Text.Pandoc.Filter.Path (expandFilterPath)
-import Text.Pandoc.Lua (LuaException (..), runPandocLua)
+import Text.Pandoc.Lua (LuaException (..), runLua)
import Text.Pandoc.Lua.Filter (LuaFilter, walkMWithLuaFilter)
import Text.Pandoc.Lua.Global (Global (..), setGlobals)
import Text.Pandoc.Lua.Util (dofileWithTraceback)
@@ -59,7 +59,7 @@ apply ropts args f doc = do
let format = case args of
(x:_) -> x
_ -> error "Format not supplied for Lua filter"
- runPandocLua >=> forceResult filterPath $ do
+ runLua >=> forceResult filterPath $ do
setGlobals [ FORMAT format
, PANDOC_READER_OPTIONS ropts
, PANDOC_SCRIPT_FILE filterPath
diff --git a/src/Text/Pandoc/Lua.hs b/src/Text/Pandoc/Lua.hs
index 72e66808c..3f4d2df07 100644
--- a/src/Text/Pandoc/Lua.hs
+++ b/src/Text/Pandoc/Lua.hs
@@ -28,8 +28,8 @@ Running pandoc Lua filters.
-}
module Text.Pandoc.Lua
( LuaException (..)
- , runPandocLua
+ , runLua
) where
-import Text.Pandoc.Lua.Init (LuaException (..), runPandocLua)
+import Text.Pandoc.Lua.Init (LuaException (..), runLua)
diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs
index c9ee7267a..e922e3d93 100644
--- a/src/Text/Pandoc/Lua/Init.hs
+++ b/src/Text/Pandoc/Lua/Init.hs
@@ -29,7 +29,7 @@ Functions to initialize the Lua interpreter.
module Text.Pandoc.Lua.Init
( LuaException (..)
, LuaPackageParams (..)
- , runPandocLua
+ , runLua
, initLuaState
, luaPackageParams
) where
@@ -56,8 +56,8 @@ newtype LuaException = LuaException String deriving (Show)
-- | Run the lua interpreter, using pandoc's default way of environment
-- initialization.
-runPandocLua :: Lua a -> PandocIO (Either LuaException a)
-runPandocLua luaOp = do
+runLua :: Lua a -> PandocIO (Either LuaException a)
+runLua luaOp = do
luaPkgParams <- luaPackageParams
globals <- defaultGlobals
enc <- liftIO $ getForeignEncoding <* setForeignEncoding utf8
diff --git a/src/Text/Pandoc/Writers/Custom.hs b/src/Text/Pandoc/Writers/Custom.hs
index 7eb982f4b..acf18fba9 100644
--- a/src/Text/Pandoc/Writers/Custom.hs
+++ b/src/Text/Pandoc/Writers/Custom.hs
@@ -44,7 +44,7 @@ import Text.Pandoc.Class (PandocIO)
import Text.Pandoc.Definition
import Text.Pandoc.Error
import Text.Pandoc.Lua.Global (Global (..), setGlobals)
-import Text.Pandoc.Lua.Init (LuaException (LuaException), runPandocLua)
+import Text.Pandoc.Lua.Init (LuaException (LuaException), runLua)
import Text.Pandoc.Lua.StackInstances ()
import Text.Pandoc.Lua.Util (addField, dofileWithTraceback)
import Text.Pandoc.Options
@@ -111,7 +111,7 @@ writeCustom luaFile opts doc@(Pandoc meta _) = do
let globals = [ PANDOC_DOCUMENT doc
, PANDOC_SCRIPT_FILE luaFile
]
- res <- runPandocLua $ do
+ res <- runLua $ do
setGlobals globals
stat <- dofileWithTraceback luaFile
-- check for error in lua script (later we'll change the return type