- Added variables to easily change used styles
This commit is contained in:
parent
b4add2e034
commit
00e4a4af84
13
pret-pas.lua
13
pret-pas.lua
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue