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