Kostis Sagonas
e9c4d77bea
Fix specs so that they correspond to the code
pirms 13 gadiem
Andrew Thompson
79b8fd1b05
Don't break printing lists of binaries
pirms 13 gadiem
Andrew Thompson
6b7f1dd4a3
Support for printing bitstrings (reported by @freeaakk )
Bitstrings are binaries that don't end on an 8 bit boundary, so dealing
with the trailing bits is annoying. Thanks to the bit_size bif we don't
have to resort to io_lib for printing them.
pirms 13 gadiem
Bryan Fink
c2b5f9f67c
don't quote atoms just for containing numerals
As long as the numeral is not the first character, it shouldn't force
quoting on the atom. For example, abc123 does not need quotes.
pirms 13 gadiem
Brendan Hay
446ca91d50
Prefixing alist/3 error to make it compile on R13A
pirms 13 gadiem
Andrew Thompson
5068e29383
Fix a couple minor issues with length calculation, add tests
pirms 13 gadiem
Andrew Thompson
3311702a6d
Add builtin chomping to lager_format
pirms 13 gadiem
Andrew Thompson
31d9529e3e
Default to treating lists as strings, (and set it false for ~w)
pirms 13 gadiem
Andrew Thompson
9c6ce62ff8
Fix some more formatting bugs
pirms 13 gadiem
Andrew Thompson
9e735a72ad
Improve tests, fix some minor bugs
pirms 13 gadiem
Andrew Thompson
d16dfaa0f8
Implement ~P/~W style depth-limiting
pirms 13 gadiem
Andrew Thompson
e5b58fc71e
Implement print options for trunc_io so ~s/~p/~w emulation is more accurate
Specifically, the handling of lists/binaries/atoms is closer to
io_lib:format's behaviour, and some regular expressions are eliminated.
pirms 13 gadiem
Andrew Thompson
e45d5bc3c9
Implement an alternative and much faster lager_trunc_io:format/3
pirms 13 gadiem
Andrew Thompson
5140cb3449
Don't convert \r, etc to spaces, don't assume printablility by first char
pirms 13 gadiem
Andrew Thompson
7e9da648db
Several fixes for printing binaries, improve quote stripping
In string mode, "..", '..' and <<"..">> are stripped, just like with
io:format.
pirms 13 gadiem
Andrew Thompson
af4ea7f31d
Don't treat floats in a list as printable characters Reported by @bryanhughes
The test if an element in a list was in the printable range didn't
handle the case of a float in the list that compared to be in the
printable range.
pirms 13 gadiem
Andrew Thompson
a0440a9d60
Smarter doublequote stripping when printing strings with ~s
pirms 13 gadiem
Andrew Thompson
9a577df2e0
Use the io_lib_format:fwrite_g function to print floats
This is superior to float_to_list as it only prints the meaningful
digits and 1.0 isn't rendered as "1.00000000000000000000e+00".
pirms 13 gadiem
Andrew Thompson
3babca112c
Make sure atoms needing quoting are quoted.
pirms 13 gadiem
Andrew Thompson
95f87e5d8b
Remove unecessary and pointless call to lists:flatten
pirms 13 gadiem
Andrew Thompson
03d3fa1a95
Fixes and tests for deep-list handling in trunc_io:format
This solves an issue reported by 'cloudhead' in IRC where deep lists
weren't being flattened when printed with format specifiers like ~s ~p
and ~P, all of which should flatten the list.
pirms 13 gadiem
Andrew Thompson
9cbb72c3ca
Cleanup some commented out code
pirms 14 gadiem
Andrew Thompson
6a8403f371
Fix edoc generation
pirms 14 gadiem
Andrew Thompson
4ac01374fa
Rename trunc_io to lager_trunc_io to prevent clashes
pirms 14 gadiem
Andrew Thompson
d230cbaa02
More fixes found by QC and some QC improvements
pirms 14 gadiem
Andrew Thompson
71fae1b89a
Truncator for funs; special case binary truncation when max is 0
pirms 14 gadiem
Andrew Thompson
f3b9fbd0fb
Take the size of the format string into account when printing
pirms 14 gadiem
Andrew Thompson
37f190f037
Try to give more equal allocations to large terms
pirms 14 gadiem
Andrew Thompson
01dc584838
Add truc_io:format and use it in the crash logger
pirms 14 gadiem
Andrew Thompson
5bc97a9096
Forgot to add trunc_io
pirms 14 gadiem