aboutsummaryrefslogtreecommitdiff
path: root/pandoc-cli/no-lua/PandocCLI/Lua.hs
blob: 2bdfeaeb63039192f557710ceb263293a0701be1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{- |
   Module      : PandocCLI.Lua
   Copyright   : © 2022-2024 Albert Krewinkel
   License     : GPL-2.0-or-later
   Maintainer  : Albert Krewinkel <[email protected]>

Placeholder values to be used when pandoc is compiled without support
for the Lua scripting engine.
-}
module PandocCLI.Lua (runLuaInterpreter, getEngine) where

import Control.Monad.IO.Class (MonadIO)
import Text.Pandoc.Error (PandocError (PandocNoScriptingEngine), handleError)
import Text.Pandoc.Scripting (ScriptingEngine, noEngine)

-- | Raises an error, reporting that the scripting engine is unavailable.
runLuaInterpreter :: String    -- ^ Program name
                  -> [String]  -- ^ Command line arguments
                  -> IO ()
runLuaInterpreter _progName _args = do
  handleError (Left PandocNoScriptingEngine)

-- | Placeholder scripting engine.
getEngine :: MonadIO m => m ScriptingEngine
getEngine = pure noEngine