From 00e4a4af84cbe76aee50db797b428b46b4e01dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BCller?= Date: Sat, 2 Oct 2010 11:53:45 +0200 Subject: [PATCH] - Added variables to easily change used styles --- pret-pas.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pret-pas.lua b/pret-pas.lua index 5ecd7cc..a5e4830 100644 --- a/pret-pas.lua +++ b/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