diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2012-10-03 17:53:06 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2012-10-03 17:53:06 -0300 |
| commit | 370c898db13a7768888f27a5d378cd4081aaa8b7 (patch) | |
| tree | d1318974c89d9e0017eedcb3bfcbd0a73eebfacc /src | |
| parent | ef5944ef0cf6cdb04d6333020666ff8cbd7fa7fb (diff) | |
| download | luarocks-370c898db13a7768888f27a5d378cd4081aaa8b7.tar.gz luarocks-370c898db13a7768888f27a5d378cd4081aaa8b7.tar.bz2 luarocks-370c898db13a7768888f27a5d378cd4081aaa8b7.zip | |
Comment format consistency.
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/util.lua | 44 |
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) |
| 343 | end | 343 | end |
| 344 | 344 | ||
| 345 | --[[ | 345 | --- |
| 346 | Author: Julio Manuel Fernandez-Diaz | 346 | -- Formats tables with cycles recursively to any depth. |
| 347 | Date: 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 | |
| 350 | Formats tables with cycles recursively to any depth. | 350 | -- (in the case in which indent is composed by spaces or "--"). |
| 351 | The output is returned as a string. | 351 | -- Userdata and function keys and values are shown as strings, |
| 352 | References to other tables are shown as values. | 352 | -- which logically are exactly not equivalent to the original code. |
| 353 | Self references are indicated. | 353 | -- This routine can serve for pretty formating tables with |
| 354 | 354 | -- proper indentations, apart from printing them: | |
| 355 | The 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, |
| 357 | Userdata and function keys and values are shown as strings, | 357 | -- Heavily based on "Saving tables with cycles", PIL2, p. 113. |
| 358 | which 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) | |
| 360 | This routine can serve for pretty formating tables with | 360 | -- @param indent string: is a first indentation (optional). |
| 361 | proper indentations, apart from printing them: | 361 | -- @return string: the pretty-printed table |
| 362 | |||
| 363 | io.write(table.show(t, "t")) -- a typical use | ||
| 364 | |||
| 365 | Heavily based on "Saving tables with cycles", PIL2, p. 113. | ||
| 366 | |||
| 367 | Arguments: | ||
| 368 | t is the table. | ||
| 369 | name is the name of the table (optional) | ||
| 370 | indent is a first indentation (optional). | ||
| 371 | --]] | ||
| 372 | function show_table(t, name, indent) | 362 | function 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 |
