aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-11-05 13:11:02 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2021-11-05 13:11:02 +0100
commitebdb39b3b4d297ea2356063d48f5e472e8ffa9d3 (patch)
tree5c10223a407a68d76310c4762f65ffe7b3993cad /src
parentd089d799e7c40a269a3b80e5fd40dc0fbfb5e6de (diff)
downloadpandoc-ebdb39b3b4d297ea2356063d48f5e472e8ffa9d3.tar.gz
Lua: display Pandoc values using their native Haskell representation
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Lua/Marshaling/AST.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs
index e73ff43b5..568b610cc 100644
--- a/src/Text/Pandoc/Lua/Marshaling/AST.hs
+++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs
@@ -85,6 +85,10 @@ typePandoc = deftype "Pandoc"
<#> parameter (optional . peekPandoc) "doc1" "pandoc" ""
<#> parameter (optional . peekPandoc) "doc2" "pandoc" ""
=#> functionResult pushBool "boolean" "true iff the two values are equal"
+ , operation Tostring $ lambda
+ ### liftPure show
+ <#> parameter peekPandoc "Pandoc" "doc" ""
+ =#> functionResult pushString "string" "native Haskell representation"
]
[ property "blocks" "list of blocks"
(pushPandocList pushBlock, \(Pandoc _ blks) -> blks)