Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: tools/lua/dumpops.lua

Issue 15737010: add dumpops.lua as a sample scraper that just dumps the arguments (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkLuaCanvas.cpp ('k') | tools/lua/scrape.lua » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lua/dumpops.lua
diff --git a/tools/lua/dumpops.lua b/tools/lua/dumpops.lua
new file mode 100644
index 0000000000000000000000000000000000000000..1667e579fa9100229656f731f33a647edd21c735
--- /dev/null
+++ b/tools/lua/dumpops.lua
@@ -0,0 +1,34 @@
+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
+
« no previous file with comments | « src/utils/SkLuaCanvas.cpp ('k') | tools/lua/scrape.lua » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698