From 235026f7d5893be5c3e2307e6dc61424e1aa91d2 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 3 Apr 2024 22:45:59 -0500 Subject: Change pp -> dump Keep them 4 letter file name boiiii --- pp.lua | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 pp.lua (limited to 'pp.lua') diff --git a/pp.lua b/pp.lua deleted file mode 100644 index 4d9d9af..0000000 --- a/pp.lua +++ /dev/null @@ -1,37 +0,0 @@ ---- lam.pp - -local pp = {} -local type = require "type" -local unpack = table.unpack or unpack - -function pp.dump (x, lvl) - lvl = lvl or 0 - local space = string.rep(" ", lvl) - local output = "" - --[[if getmetatable(x) and getmetatable(x).__tostring then - output = output .. tostring(x) - else]]if type.luatype(x) == "table" then - local subo = "" - for k,v in pairs(x) do - if v == x then - v = "self" - else - v = pp.dump(v, lvl+2) - end - subo = subo .. string.format("\n%s[%s] = %s,", - (space.." "), k, v) - end - output = output .. string.format("\n%s{%s\n%s}", - space, subo, space) - else - output = output .. tostring(x) - end - return output -end - -function pp.pp (x) - print(pp.dump(x)) -end - ---- -return pp -- cgit 1.4.1-21-gabe81