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 print("Looking at '" .. str .. "'")
15 if utf.match(str, '^ ') then
17 -- Eat the first character
20 local text, rest = utf.match(str, "^%-%-(.-)%-%-(.*)")
22 tex.sprint('\\strikethrough{')
23 -- Recursively call ourselves to handle spaces gracefully.
24 visualizer.flush_line(text)
26 -- Eat the processed characters
29 -- Write the first character
30 tex.write(utf.sub(str, 1, 1))
31 -- Eat the first character
38 -- vim: set sw=4 sts=4 expandtab ai: