Kostis Sagonas
e9c4d77bea
Fix specs so that they correspond to the code
13 lat temu
Andrew Thompson
79b8fd1b05
Don't break printing lists of binaries
13 lat temu
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.
13 lat temu
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.
13 lat temu
Brendan Hay
446ca91d50
Prefixing alist/3 error to make it compile on R13A
13 lat temu
Andrew Thompson
5068e29383
Fix a couple minor issues with length calculation, add tests
13 lat temu
Andrew Thompson
3311702a6d
Add builtin chomping to lager_format
13 lat temu
Andrew Thompson
31d9529e3e
Default to treating lists as strings, (and set it false for ~w)
13 lat temu
Andrew Thompson
9c6ce62ff8
Fix some more formatting bugs
13 lat temu
Andrew Thompson
9e735a72ad
Improve tests, fix some minor bugs
13 lat temu
Andrew Thompson
d16dfaa0f8
Implement ~P/~W style depth-limiting
13 lat temu
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.
13 lat temu
Andrew Thompson
e45d5bc3c9
Implement an alternative and much faster lager_trunc_io:format/3
13 lat temu
Andrew Thompson
5140cb3449
Don't convert \r, etc to spaces, don't assume printablility by first char
13 lat temu
Andrew Thompson
7e9da648db
Several fixes for printing binaries, improve quote stripping
In string mode, "..", '..' and <<"..">> are stripped, just like with
io:format.
13 lat temu
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.
13 lat temu
Andrew Thompson
a0440a9d60
Smarter doublequote stripping when printing strings with ~s
13 lat temu
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".
13 lat temu
Andrew Thompson
3babca112c
Make sure atoms needing quoting are quoted.
13 lat temu
Andrew Thompson
95f87e5d8b
Remove unecessary and pointless call to lists:flatten
13 lat temu
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.
13 lat temu
Andrew Thompson
9cbb72c3ca
Cleanup some commented out code
13 lat temu
Andrew Thompson
6a8403f371
Fix edoc generation
13 lat temu
Andrew Thompson
4ac01374fa
Rename trunc_io to lager_trunc_io to prevent clashes
14 lat temu
Andrew Thompson
d230cbaa02
More fixes found by QC and some QC improvements
14 lat temu
Andrew Thompson
71fae1b89a
Truncator for funs; special case binary truncation when max is 0
14 lat temu
Andrew Thompson
f3b9fbd0fb
Take the size of the format string into account when printing
14 lat temu
Andrew Thompson
37f190f037
Try to give more equal allocations to large terms
14 lat temu
Andrew Thompson
01dc584838
Add truc_io:format and use it in the crash logger
14 lat temu
Andrew Thompson
5bc97a9096
Forgot to add trunc_io
14 lat temu