aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2017-10-03 20:45:11 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2017-10-03 20:45:11 +0200
commit371f9b708478700992a74864985cfea0af2fd4c3 (patch)
tree0eb4c00af3079b2342ae452ec285cd28f5155944 /src/Text/Pandoc
parent9b750f7d879b1da386e49ecfd51ef9d023dc5d66 (diff)
downloadpandoc-371f9b708478700992a74864985cfea0af2fd4c3.tar.gz
pandoc.lua: use wrapper funciton for pipe command
The pipe command is wrapped in a lua function, throwing a lua error if the command returns with an error. A wrapper is needed as Haskell functions exposed to lua may not throw lua errors due to limitations of hslua. The error handling is written such that a table can be returned as an error object in the future. This is potentially useful when finer control is required while catching the error in lua code. Current limitations of hslua require error objects to be strings.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Lua/PandocModule.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Lua/PandocModule.hs b/src/Text/Pandoc/Lua/PandocModule.hs
index c689edc4e..f9b072dff 100644
--- a/src/Text/Pandoc/Lua/PandocModule.hs
+++ b/src/Text/Pandoc/Lua/PandocModule.hs
@@ -63,7 +63,7 @@ pushPandocModule datadir = do
script <- liftIO (pandocModuleScript datadir)
status <- Lua.loadstring script
unless (status /= Lua.OK) $ Lua.call 0 1
- addFunction "pipe" pipeFn
+ addFunction "_pipe" pipeFn
addFunction "_read" readDoc
addFunction "sha1" sha1HashFn