Skip to content

Commit

Permalink
pp.dump bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hnes committed Jun 15, 2017
1 parent 810518f commit 04721db
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lua-parser/pp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,12 @@ end
function pp.dump (t, i)
if i == nil then i = 0 end
io.write(string.format("{\n"))
io.write(string.format("%s[tag] = %s\n", string.rep(" ", i+2), t.tag))
io.write(string.format("%s[pos] = %s\n", string.rep(" ", i+2), t.pos))
if type(t.tag) ~= "nil" then
io.write(string.format("%s[tag] = %s\n", string.rep(" ", i+2), t.tag))
end
if type(t.pos) ~= "nil" then
io.write(string.format("%s[pos] = %s\n", string.rep(" ", i+2), t.pos))
end
for k,v in ipairs(t) do
io.write(string.format("%s[%s] = ", string.rep(" ", i+2), tostring(k)))
if type(v) == "table" then
Expand Down

0 comments on commit 04721db

Please sign in to comment.