c;leaned up prints

This commit is contained in:
Ryan Ward 2019-03-28 14:32:08 -04:00
parent 0880687e15
commit 7d5405f126

View File

@ -401,7 +401,7 @@ local function pieceList(list,self,name)
local L={} local L={}
for i=1,#list do for i=1,#list do
if list[i]:match("[%w_]-%[.-%]") and list[i]:sub(1,1)~='"' then if list[i]:match("[%w_]-%[.-%]") and list[i]:sub(1,1)~='"' then
print("dict") -- print("dict")
local dict,sym=list[i]:match("([%w_]-)%[(.-)%]") local dict,sym=list[i]:match("([%w_]-)%[(.-)%]")
if tonumber(sym) then if tonumber(sym) then
L[#L+1]={"\1"..dict,tonumber(sym),IsALookup=true} L[#L+1]={"\1"..dict,tonumber(sym),IsALookup=true}
@ -414,35 +414,35 @@ local function pieceList(list,self,name)
L[#L+1]="\1"..sym L[#L+1]="\1"..sym
end end
elseif list[i]:sub(1,1)=="\"" and list[i]:sub(-1,-1)=="\"" then elseif list[i]:sub(1,1)=="\"" and list[i]:sub(-1,-1)=="\"" then
print("string") -- print("string")
L[#L+1]=list[i]:sub(2,-2) L[#L+1]=list[i]:sub(2,-2)
elseif list[i]:sub(1,1)=="[" and list[i]:sub(-1,-1)=="]" then elseif list[i]:sub(1,1)=="[" and list[i]:sub(-1,-1)=="]" then
print("index") -- print("index")
L[#L+1]=pieceList(list[i]:sub(2,-2),self,name) L[#L+1]=pieceList(list[i]:sub(2,-2),self,name)
elseif tonumber(list[i]) then elseif tonumber(list[i]) then
print("number") -- print("number")
L[#L+1]=tonumber(list[i]) L[#L+1]=tonumber(list[i])
elseif list[i]=="true" then elseif list[i]=="true" then
print("true") -- print("true")
L[#L+1]=true L[#L+1]=true
elseif list[i]=="false" then elseif list[i]=="false" then
print("false") -- print("false")
L[#L+1]=false L[#L+1]=false
elseif list[i]:match("[%w_]+")==list[i] then elseif list[i]:match("[%w_]+")==list[i] then
print("var?") -- print("var?")
L[#L+1]="\1"..list[i] L[#L+1]="\1"..list[i]
elseif list[i]:match("[%w_]-%..-") then elseif list[i]:match("[%w_]-%..-") then
print("dict?") -- print("dict?")
local dict,sym=list[i]:match("([%w_]-)%.(.+)") local dict,sym=list[i]:match("([%w_]-)%.(.+)")
L[#L+1]={"\1"..dict,sym,IsALookup=true} L[#L+1]={"\1"..dict,sym,IsALookup=true}
elseif list[i]:match("^([%w_]+)%s*%((.*)%)$") then elseif list[i]:match("^([%w_]+)%s*%((.*)%)$") then
print("func") -- print("func")
local func,args = list[i]:match("^([%w_]+)%s*%((.*)%)$") local func,args = list[i]:match("^([%w_]+)%s*%((.*)%)$")
local sym = getSymbol("`") local sym = getSymbol("`")
self:compileFWR(func,sym,args,name) self:compileFWR(func,sym,args,name)
L[#L+1]="\1"..sym L[#L+1]="\1"..sym
elseif list[i]:match("[_%w%+%-/%*%^%(%)%%]+") and list[i]:match("[%+%-/%*%^%%]+") then elseif list[i]:match("[_%w%+%-/%*%^%(%)%%]+") and list[i]:match("[%+%-/%*%^%%]+") then
print("math") -- print("math")
local char=getSymbol("$") local char=getSymbol("$")
self:compileExpr(char,list[i],name) self:compileExpr(char,list[i],name)
L[#L+1]="\1"..char L[#L+1]="\1"..char
@ -636,7 +636,6 @@ function parseManager:compileExpr(eql,expr,name)
end end
function parseManager:pieceExpr(expr) function parseManager:pieceExpr(expr)
local count=0 local count=0
print("EXPR-A:",expr)
for i,v in pairs(self.methods) do for i,v in pairs(self.methods) do
expr=expr:gsub(i.."(%b())",function(a) expr=expr:gsub(i.."(%b())",function(a)
a=a:sub(2,-2) a=a:sub(2,-2)
@ -647,11 +646,8 @@ function parseManager:compileExpr(eql,expr,name)
return "@" return "@"
end) end)
end end
print("EXPR-B:",expr)
for i,v in pairs(self.cFuncs) do for i,v in pairs(self.cFuncs) do
print("!",i,v,expr)
expr=expr:gsub(i.."(%b())",function(a) expr=expr:gsub(i.."(%b())",function(a)
print("MET:",i..a)
a=a:sub(2,-2) a=a:sub(2,-2)
if a:sub(1,1)=="-" then if a:sub(1,1)=="-" then
a="0"..a a="0"..a
@ -661,7 +657,7 @@ function parseManager:compileExpr(eql,expr,name)
end) end)
end--self.cFuncs end--self.cFuncs
expr=expr:gsub("%b()",function(a) expr=expr:gsub("%b()",function(a)
print(">",a) -- print(">",a)
return self:pieceExpr(a:sub(2,-2)) return self:pieceExpr(a:sub(2,-2))
end) end)
local loop local loop
@ -680,7 +676,7 @@ function parseManager:compileExpr(eql,expr,name)
end end
end end
if expr:match("[!%$%s&_%w%+%-,/%*%.%^%(%)%%]+")==expr then if expr:match("[!%$%s&_%w%+%-,/%*%.%^%(%)%%]+")==expr then
print(expr) -- print(expr)
expr = expr:gsub("%s","") expr = expr:gsub("%s","")
parseManager:pieceExpr(expr) parseManager:pieceExpr(expr)
cmds[#cmds]["vars"]={"\1"..eql} cmds[#cmds]["vars"]={"\1"..eql}