I'm working on a library for tic80,
I already have some part that are optimised the way I want
I would like to prevent pakettic to do further "destructive" optimisation to keep clarity even in the minified version.
It would be interesting to have a magic comment like --< and --> that would limit pakettic to be limited on whitespace optimisation
An extended version --<< and -->> would tell to even keep whitespace like it is
And finaly a --i"" would force to insert some content for release
An example:
--<
local TG={}
--i"\n"
function TG:BeginTabs(x,y,w,h)
-->
line(x, y+8, x+w-1, y+8, self.theme.dark)
return self:Element(true, x, y, w, h)
end
--i"\n"
--<
function TG:BeginTab(t,o,x,y,w,h)
-->
if o==nil then o=self:state().open end
o = self:Button(t, x,y, w,h) or o
return self:Element(o, x,y, w,h)
end
For now it optimise as
local s={} s.BeginTabs=function(self,k,u,g,h)line(k,u+8,k+g-1,u+8,self.theme.dark)return self:Element(true,k,u,g,h)end s.BeginTab=function(self,o,m,k,u,g,h)if nil==m then m=self:state().open end m=self:Button(o,k,u,g,h)or m return self:Element(m,k,u,g,h)end
I would prefer that it does that
local TG={}
function TG:BeginTabs(x,y,w,h)line(x,y+8,x+w-1,y+8,self.theme.dark)return self:Element(true,x,y,w,h)end
function TG:BeginTab(t,o,x,y,w,h)if nil==o then o=self:state().open end o=self:Button(t,x,y,w,h)or o return self:Element(o,x,y,w,h)end
I'm working on a library for tic80,
I already have some part that are optimised the way I want
I would like to prevent pakettic to do further "destructive" optimisation to keep clarity even in the minified version.
It would be interesting to have a magic comment like --< and --> that would limit pakettic to be limited on whitespace optimisation
An extended version --<< and -->> would tell to even keep whitespace like it is
And finaly a --i"" would force to insert some content for release
An example:
end
For now it optimise as
I would prefer that it does that