Module pl.pretty

Pretty-printing Lua tables

Functions

read (s) read a string representation of a Lua table.
write (tbl, space, not_clever, a) create a string representation of a Lua table.


Functions

read (s)
read a string representation of a Lua table. Uses loadstring, but tries to be cautious about loading arbitrary code! It is expecting a string of the form '{...}', with perhaps some whitespace before or after the curly braces. An empty environment is used, and any occurance of the keyword 'function' will be considered a problem.

Parameters:

  • s:
write (tbl, space, not_clever, a)
create a string representation of a Lua table.

Parameters:

  • tbl:
  • space: the indent to use (defaults to two spaces)
  • not_clever:
  • a: table

Valid XHTML 1.0!