From 0250c0f0141416cdb1e6734eabc23b18e0aa2225 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Mon, 24 Jul 2017 19:16:29 +0200 Subject: [PATCH] TODO structure --- README.md | 24 ++++++++++++++++-------- pretty.lua | 1 + 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f543840..614e77f 100644 --- a/README.md +++ b/README.md @@ -102,19 +102,27 @@ option a bad value. ## TODO -I'm looking into implementing following features: +Tasks to be done before `pretty` can be called version 1.0.0, in order of +priority: -- Add a dedicated unicode submodule, to handle a bunch of cases. -- Add support for `setmetatable`, and exploring the values accessible through - it. +- Depricate `max_depth`, `short_builtins` and `recursion` options. +- Add a dedicated unicode submodule, to handle some minor alignment and + character escaping issues. `pretty` should escape all malformed unicode + sequences. +- Align numbers towards right for tabular views. +- Add support for `setmetatable`, and exploring values in metatables. - Provide nice formatting for `cdata` datatype in LuaJIT. -- Expand on the comment output in output, for `__tostring` methods, and global - namespaces like `io` or `math`. -- Attempt to fit output within a predefined width limit. Default to 80. +- Find a better name than `pretty`. +- Enhance internal structure some amount. See `TODO` markers in files. + +It would be nice to have the following, but these are secondary: + - Add option for colored output. Primarily syntax highlighting, but also [BlueJ-style](www.bluej.org/about.html) scope highlighting, with some faint background colors. -- Find a better name than `pretty`. +- Expand on the comment output in output, for `__tostring` methods, and global + namespaces like `io` or `math`. +- Fit output within a predefined width limit. Default to 80. ## Alternative pretty printers diff --git a/pretty.lua b/pretty.lua index a4b8809..1e614b3 100644 --- a/pretty.lua +++ b/pretty.lua @@ -547,6 +547,7 @@ local KNOWN_OPTIONS = { _table_addr_comment = { type = 'boolean', default = false, debug = 'debug' }, -- TODO: Maybe automatically display table address when depth = 0? indent = { type = 'string', default = ' ' }, + max_depth = { type = 'number', default = math.huge }, short_builtins = { type = 'boolean', default = false }, -- TODO: Outphase this. Rather automatically use the short versions in places where it would be strange to find the function, like keys, etc. recursion = { type = 'string', default = 'ignore', accepted = {['ignore'] = true, ['marked'] = true, ['revisit'] = true} }, -- TODO: Completely depricate this option. I do not like it.