From d310f804da7d78a95835d5275f59196f9281ed84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BCller?= Date: Wed, 29 Sep 2010 19:43:27 +0200 Subject: [PATCH] - Moved common code parts --- pret-pas.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pret-pas.lua b/pret-pas.lua index 0439fea..736bb9d 100644 --- a/pret-pas.lua +++ b/pret-pas.lua @@ -96,6 +96,9 @@ local function written(state,c,i) end function visualizer.flush_line(str, nested) + local state, instr, inesc, word = 0, false, false, nil + buffers.currentcolors = colors + --[[ local identifier = nil for c in string.string.utfcharacters(str) do @@ -118,8 +121,7 @@ function visualizer.flush_line(str, nested) --flush_pas_word(identifier) identifier = nil ]] - local state, instr, inesc, word = 0, false, false, nil - buffers.currentcolors = colors + local code, comment = string.match(str,"^(.-)%-%-%[%[(.*)$") if comment then -- process the code and then flush the comment