some cleaning up

This commit is contained in:
Izaya 2017-09-13 13:06:17 +10:00
parent cce84dc5c5
commit c76bc60a20
3 changed files with 2 additions and 33 deletions

View File

@ -53,7 +53,7 @@ function tty(gA,sA,sI,fg,bg)
elseif c == "\r" then cx=1 elseif c == "\r" then cx=1
elseif c == "\f" then cx=1 cy=1 gP.fill(1, 1, sx, sy, " ") elseif c == "\f" then cx=1 cy=1 gP.fill(1, 1, sx, sy, " ")
elseif c == "\t" then cx=(cx+8-((cx+8)%8))+1 elseif c == "\t" then cx=(cx+8-((cx+8)%8))+1
elseif c == "\127" then cx=cx-1 gP.set(cx,cy," ") elseif c == "\127" then cx=cx-1 gP.set(cx,cy,(" "):rep(2))
else gP.set(cx,cy,c) cx=cx+1 else gP.set(cx,cy,c) cx=cx+1
end end
end cv() end cv()

View File

@ -1,35 +1,4 @@
_G.buffer = {} _G.buffer = {}
--[[function buffer.create(w,c) -- worker, close
local t={}
t.b=""
function t.w(s,d)
s.b=s.b..tostring(d)
end
t.write = t.w
function t.r(s,l)
if type(l) == "number" then
local ns,bs=s.b:sub(1,l+1),s.b:sub(l+2)
s.b=bs
return ns
elseif type(l) == "string" then
local oS=s.b
if l == "*a" then
s.b=""
return oS
elseif l == "*l" then
S=s.b:find("\n") or #s.b
s.b=s.b:sub(S+1)
rS = oS:sub(1,S-1)
if rS:len() < 1 then return nil end
return rS
end
end
end
t.read = t.r
t.close = c
w(t)
return t
end]]--
function buffer.ucreate() function buffer.ucreate()
local b = {} local b = {}
b.b,b.s = "","open" b.b,b.s = "","open"

View File

@ -31,7 +31,7 @@ for k,v in ipairs(replacements) do
no=no+1 no=no+1
end end
end end
print("\nBefore: "..sl.."\nAfter: "..tostring(ss:len()).."\n"..tostring(no).." optimisations made.\n") print("\nBefore: "..sl.."\nAfter: "..tostring(ss:len()).."\nDelta: "..tostring(sl-ss:len()))
f=io.open(tA[2],"wb") f=io.open(tA[2],"wb")
f:write(ss) f:write(ss)