skia2/tools/lua/dumpops.lua
reed@google.com 74ce6f046c add dumpops.lua as a sample scraper that just dumps the arguments
add SkLua.h for common utilities

BUG=
R=rmistry@google.com

Review URL: https://codereview.chromium.org/15737010

git-svn-id: http://skia.googlecode.com/svn/trunk@9242 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-05-22 15:13:18 +00:00

35 lines
826 B
Lua

function tostr(t)
local str = ""
for k, v in next, t do
if #str > 0 then
str = str .. ", "
end
if type(k) == "number" then
str = str .. "[" .. k .. "] = "
else
str = str .. tostring(k) .. " = "
end
if type(v) == "table" then
str = str .. "{ " .. tostr(v) .. " }"
else
str = str .. tostring(v)
end
end
return str
end
function sk_scrape_startcanvas(c, fileName) end
function sk_scrape_endcanvas(c, fileName) end
function sk_scrape_accumulate(t)
-- dump the params in t, specifically showing the verb first, which we
-- then nil out so it doesn't appear in tostr()
io.write(t.verb, " ")
t.verb = nil
io.write(tostr(t), "\n")
end
function sk_scrape_summarize() end