new pretty printer
- Nov 02, 2020
-
-
Petr Špaček authored
-
Petr Špaček authored
-
Petr Špaček authored
All strings should be properly escaped but some non-escaped versions were leaking into error messages.
-
Petr Špaček authored
Functions like trust_anchors.summary() return strings including tabs and newlines, so we do not escape those for human-readable output.
-
Petr Špaček authored
In case nothing (not even nil) is returned then do not print newline after the zero-length message. This avoids unambiguous empty line in output (is it an empty string which got printed?).
-
Petr Špaček authored
This change allows sandbox to pretty-print return values from functions which return multiple values, e.g. future net.bufsize() from MR !1026.
-
Petr Špaček authored
This slightly changes table_print() output format. table_print() output is not intended for machine consumption, use krprint.serialize_lua() or JSON for that purpose. Output from table_print is now a valid Lua expression if the input contains only serializable data types (number, string, bool, nil, table), which is nice for copy&pasting. Functions etc. are also pretty-printed but cannot be deserialized. Numbers are pretty-printed as well so their precision is reduced (as compared to krprint.serialize_lua).
-
Petr Špaček authored
-
Petr Špaček authored
-
Petr Špaček authored
Code was copied from Lua sandbox, the old copy is to be removed once new pretty-printer is finished.
-
Petr Špaček authored
At the moment it does not handle functions and other non-serializable types.
-
Petr Špaček authored
Side-effect is that keys are grouped by their type, so numbers come first and strings later..
-
Petr Špaček authored
-