aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2017-04-14 14:59:17 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2017-04-14 14:59:17 +0200
commit1d9742bb5dd976d478db877c48d9ba005ce98098 (patch)
treea998c7ec63b56d54930157df1b9ef5a38f9de1b1
parent932e395e535e10e7fdbfadd5617b7427a2141343 (diff)
downloadpandoc-1d9742bb5dd976d478db877c48d9ba005ce98098.tar.gz
Use lua bools and strings for MetaBool, MetaString
Native lua booleans and strings are used to represent MetaBool and MetaString values. This is more natural than the previous table-based representation. The old lua representation can still be read back to haskell, ensuring compatibility with the `pandoc.MetaBool` and `pandoc.MetaString` lua constructors.
-rw-r--r--src/Text/Pandoc/Lua/StackInstances.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Lua/StackInstances.hs b/src/Text/Pandoc/Lua/StackInstances.hs
index 38f392527..62beedabc 100644
--- a/src/Text/Pandoc/Lua/StackInstances.hs
+++ b/src/Text/Pandoc/Lua/StackInstances.hs
@@ -65,11 +65,11 @@ instance StackValue Meta where
instance StackValue MetaValue where
push lua = \case
MetaBlocks blcks -> pushViaConstructor lua "MetaBlocks" blcks
- MetaBool b -> pushViaConstructor lua "MetaBool" b
+ MetaBool bool -> push lua bool
MetaInlines inlns -> pushViaConstructor lua "MetaInlines" inlns
MetaList metalist -> pushViaConstructor lua "MetaList" metalist
MetaMap metamap -> pushViaConstructor lua "MetaMap" metamap
- MetaString cs -> pushViaConstructor lua "MetaString" cs
+ MetaString str -> push lua str
peek lua idx = do
luatype <- ltype lua idx
case luatype of