1 -- filename : type-haskell.lua
2 -- comment : Pretty printing of haskell programs. Currently, this is just
3 --- verbatim printing with the option of applying strikethrough
4 -- author : Matthijs Kooijman, Universiteit Twente, NL
5 -- copyright: Matthijs Kooijman
8 local utf = unicode.utf8
10 local visualizer = buffers.newvisualizer('haskell')
12 function visualizer.flush_line(str,nested)
14 if utf.match(str, '^ ') then
16 -- Eat the first character
19 local text, rest = utf.match(str, "^%-%-(.-)%-%-(.*)")
21 tex.sprint('\\strikethrough{')
22 -- Recursively call ourselves to handle spaces gracefully.
23 visualizer.flush_line(text)
25 -- Eat the processed characters
28 -- Write the first character
29 tex.write(utf.sub(str, 1, 1))
30 -- Eat the first character
37 -- vim: set sw=4 sts=4 expandtab ai: