aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2012-10-03 17:53:06 -0300
committerHisham Muhammad <hisham@gobolinux.org>2012-10-03 17:53:06 -0300
commit370c898db13a7768888f27a5d378cd4081aaa8b7 (patch)
treed1318974c89d9e0017eedcb3bfcbd0a73eebfacc /src
parentef5944ef0cf6cdb04d6333020666ff8cbd7fa7fb (diff)
downloadluarocks-370c898db13a7768888f27a5d378cd4081aaa8b7.tar.gz
luarocks-370c898db13a7768888f27a5d378cd4081aaa8b7.tar.bz2
luarocks-370c898db13a7768888f27a5d378cd4081aaa8b7.zip
Comment format consistency.
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/util.lua44
1 files changed, 17 insertions, 27 deletions
diff --git a/src/luarocks/util.lua b/src/luarocks/util.lua
index 1a1cccf9..512644c6 100644
--- a/src/luarocks/util.lua
+++ b/src/luarocks/util.lua
@@ -342,33 +342,23 @@ function remove_path_dupes(list, sep)
342 return table.concat(final, sep) 342 return table.concat(final, sep)
343end 343end
344 344
345--[[ 345---
346Author: Julio Manuel Fernandez-Diaz 346-- Formats tables with cycles recursively to any depth.
347Date: January 12, 2007 347-- References to other tables are shown as values.
348(For Lua 5.1) 348-- Self references are indicated.
349 349-- The string returned is "Lua code", which can be procesed
350Formats tables with cycles recursively to any depth. 350-- (in the case in which indent is composed by spaces or "--").
351The output is returned as a string. 351-- Userdata and function keys and values are shown as strings,
352References to other tables are shown as values. 352-- which logically are exactly not equivalent to the original code.
353Self references are indicated. 353-- This routine can serve for pretty formating tables with
354 354-- proper indentations, apart from printing them:
355The string returned is "Lua code", which can be procesed 355-- io.write(table.show(t, "t")) -- a typical use
356(in the case in which indent is composed by spaces or "--"). 356-- Written by Julio Manuel Fernandez-Diaz,
357Userdata and function keys and values are shown as strings, 357-- Heavily based on "Saving tables with cycles", PIL2, p. 113.
358which logically are exactly not equivalent to the original code. 358-- @param t table: is the table.
359 359-- @param name string: is the name of the table (optional)
360This routine can serve for pretty formating tables with 360-- @param indent string: is a first indentation (optional).
361proper indentations, apart from printing them: 361-- @return string: the pretty-printed table
362
363io.write(table.show(t, "t")) -- a typical use
364
365Heavily based on "Saving tables with cycles", PIL2, p. 113.
366
367Arguments:
368t is the table.
369name is the name of the table (optional)
370indent is a first indentation (optional).
371--]]
372function show_table(t, name, indent) 362function show_table(t, name, indent)
373 local cart -- a container 363 local cart -- a container
374 local autoref -- for self references 364 local autoref -- for self references