projects
/
matthijs
/
master-project
/
report.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a section on prototype implementation (with the git url).
[matthijs/master-project/report.git]
/
pret-haskell.lua
diff --git
a/pret-haskell.lua
b/pret-haskell.lua
index f1dc31bdc421aea7cf2dbd0842463a98cb963432..ca3a1651d520ae2c13f99426f45af90f2498c4cc 100644
(file)
--- a/
pret-haskell.lua
+++ b/
pret-haskell.lua
@@
-14,7
+14,7
@@
local visualizer = buffers.newvisualizer('haskell')
-- macro's that should be interpreted. Does not insert any automatic
-- linebreaking.
local function ctxsprint(str)
-- macro's that should be interpreted. Does not insert any automatic
-- linebreaking.
local function ctxsprint(str)
- tex.sprint(ctxcatcodes, str)
+ tex.sprint(
tex.
ctxcatcodes, str)
end
-- Print a string or table of strings almost literal. Each character in the
end
-- Print a string or table of strings almost literal. Each character in the
@@
-40,6
+40,13
@@
function visualizer.flush_line(str,nested)
ctxsprint('}')
-- Eat the processed characters
str = rest
ctxsprint('}')
-- Eat the processed characters
str = rest
+ elseif utf.match(str, "^%-%-") then
+ ctxsprint('{\\italic{--')
+ -- Recursively call ourselves to handle spaces gracefully.
+ visualizer.flush_line(utf.sub(str, 3))
+ ctxsprint('}}')
+ -- Done with this line
+ str = ''
else
-- Write the first character
texwrite(utf.sub(str, 1, 1))
else
-- Write the first character
texwrite(utf.sub(str, 1, 1))