- Added variables to easily change used styles

This commit is contained in:
Stefan Müller 2010-10-02 11:53:45 +02:00
parent b4add2e034
commit 00e4a4af84
1 changed files with 8 additions and 5 deletions

View File

@ -62,11 +62,14 @@ local states = {
['--']=4,
}
local reserved_style = "\{\\bf "
local comment_style = "\{\\sl "
local function flush_pas_word(word)
if word then
local id = known_words[string.lower(word)]
if id then
tex.sprint(tex.ctxcatcodes, "\{\\bf ")
tex.sprint(tex.ctxcatcodes, reserved_style)
tex.write(word)
tex.sprint(tex.ctxcatcodes, "\}")
else
@ -160,7 +163,7 @@ function visualizer.flush_line(str, nested)
else
state = buffers.changestate(3, state)
end
tex.sprint(tex.ctxcatcodes, "\{\\bf")
tex.sprint(tex.ctxcatcodes, comment_style)
end
local c, word = nil, nil
@ -232,7 +235,7 @@ function visualizer.flush_line(str, nested)
-- one-line comment starts
incomment = true
state = buffers.changestate(3, state)
tex.sprint(tex.ctxcatcodes, "\{\\bf")
tex.sprint(tex.ctxcatcodes, comment_style)
tex.write(c)
elseif c == "{" then
incomment = true
@ -245,14 +248,14 @@ function visualizer.flush_line(str, nested)
inlongcomment = true
state = buffers.changestate(3, state)
end
tex.sprint(tex.ctxcatcodes, "\{\\bf")
tex.sprint(tex.ctxcatcodes, comment_style)
tex.write(c)
elseif (c == "(") and (nextc == "*") then
-- long comment (alternative) starts
incomment = true
inlongcomment_alt = 2
state = buffers.changestate(3, state)
tex.sprint(tex.ctxcatcodes, "\{\\bf")
tex.sprint(tex.ctxcatcodes, comment_style)
tex.write(c)
-- TODO: asm
else