- Replaced leading whitespaces by tabs

This commit is contained in:
Stefan Müller 2010-10-25 12:14:58 +02:00
parent e8dccbf5d8
commit b8ded16210
1 changed files with 16 additions and 16 deletions

View File

@ -1,9 +1,9 @@
if not modules then modules = { } end modules ['pret-pas'] = {
version = 1.0,
comment = "custom pretty printer for Pascal code",
author = "Stefan Müller, Chemnitz DE",
copyright = "Stefan Müller",
license = "see context related readme files"
version = 1.0,
comment = "custom pretty printer for Pascal code",
author = "Stefan Müller, Chemnitz DE",
copyright = "Stefan Müller",
license = "see context related readme files"
}
-- The code formatting is adapted from Lazarus, a Free Pascal RAD IDE, which
@ -31,7 +31,7 @@ visualizer.reservedwords = {
-- "dispose", "exit", "false", "new", "true",
-- Object Pascal
"as", "class", "dispinterface", "except", "exports", "finalization",
"as", "class", "dispinterface", "except", "exports", "finalization",
"finally", "initialization", "inline", "is", "library", "on", "out",
"packed", "property", "raise", "resourcestring", "threadvar", "try",
@ -48,14 +48,14 @@ visualizer.reservedwords = {
local known_words = { }
for k,v in next, visualizer.reservedwords do
known_words[v] = k
known_words[v] = k
end
local colors = {
"prettyone", -- red: compiler directive, symbol
"prettytwo", -- green: assembler (dark green)
"prettythree", -- blue: comment, number (dark blue)
"prettyfour", -- yellow
"prettyone", -- red: compiler directive, symbol
"prettytwo", -- green: assembler (dark green)
"prettythree", -- blue: comment, number (dark blue)
"prettyfour", -- yellow
}
local reserved_style = "\{\\bf "
@ -64,7 +64,7 @@ local comment_style = "\{\\sl "
local inlongcomment, inlongcomment_alt, incompdirec, inasm = false, 0, false, false
local function flush_pas_word(word, state)
if word then
if word then
local lword = string.lower(word)
local id = known_words[lword]
if id then
@ -88,7 +88,7 @@ local function flush_pas_word(word, state)
tex.write(word)
end
else
tex.write(word)
tex.write(word)
end
end
return state
@ -112,14 +112,14 @@ local function flush_whatever(str)
end
function visualizer.reset()
inlongcomment, inlongcomment_alt, incompdirec, inasm = false, 0, false, false
inlongcomment, inlongcomment_alt, incompdirec, inasm = false, 0, false, false
end
function visualizer.flush_line(str, nested)
local state = 0
local state = 0
local incomment, instring = false, false
--local code, comment = nil, nil
buffers.currentcolors = colors
buffers.currentcolors = colors
if inlongcomment or (inlongcomment_alt == 2) or incompdirec then
incomment = true