Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update print_r.lua #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions print_r.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local function print_r ( t )
for i = 1, tLen do
local val = t[i]
if (type(val)=="table") then
print(indent.."#["..i.."] => "..tostring(t).." {")
print(indent.."#["..i.."] => "..tostring(val).." {")
sub_print_r(val,indent..string.rep(" ",string.len(i)+8))
print(indent..string.rep(" ",string.len(i)+6).."}")
elseif (type(val)=="string") then
Expand All @@ -22,7 +22,7 @@ local function print_r ( t )
for pos,val in pairs(t) do
if type(pos) ~= "number" or math.floor(pos) ~= pos or (pos < 1 or pos > tLen) then
if (type(val)=="table") then
print(indent.."["..pos.."] => "..tostring(t).." {")
print(indent.."["..pos.."] => "..tostring(val).." {")
sub_print_r(val,indent..string.rep(" ",string.len(pos)+8))
print(indent..string.rep(" ",string.len(pos)+6).."}")
elseif (type(val)=="string") then
Expand Down