|
|
@ -93,6 +93,8 @@ pPrint(Term, Col, Ll, D, M, RecDefFun) -> |
|
|
|
%% Col = current column, default 1 |
|
|
|
%% Ll = line length/~p field width, default 80 |
|
|
|
%% M = CHAR_MAX (-1 if no max, 60 when printing from shell) |
|
|
|
%%Term, Precision, Width, Depth, -1, CharsLimit, no_fun, Encoding, Strings |
|
|
|
|
|
|
|
print(_, _, _, 0, _M, _T, _RF, _Enc, _Str) -> "..."; |
|
|
|
print(_, _, _, _D, _M, 0, _RF, _Enc, _Str) -> "..."; |
|
|
|
print(Term, Col, Ll, D, M, T, RecDefFun, Enc, Str) when Col =< 0 -> |
|
|
@ -100,10 +102,7 @@ print(Term, Col, Ll, D, M, T, RecDefFun, Enc, Str) when Col =< 0 -> |
|
|
|
print(Term, 1, Ll, D, M, T, RecDefFun, Enc, Str); |
|
|
|
print(Atom, _Col, _Ll, _D, _M, _T, _RF, Enc, _Str) when is_atom(Atom) -> |
|
|
|
write_atom(Atom, Enc); |
|
|
|
print(Term, Col, Ll, D, M0, T, RecDefFun, Enc, Str) when is_tuple(Term); |
|
|
|
is_list(Term); |
|
|
|
is_map(Term); |
|
|
|
is_bitstring(Term) -> |
|
|
|
print(Term, Col, Ll, D, M0, T, RecDefFun, Enc, Str) when is_tuple(Term); is_list(Term); is_map(Term); is_bitstring(Term) -> |
|
|
|
%% preprocess and compute total number of chars |
|
|
|
{_, Len, _Dots, _} = If = |
|
|
|
case T < 0 of |
|
|
@ -539,10 +538,7 @@ print_length(<<_/bitstring>> = Bin, 1, _T, RF, Enc, Str) -> |
|
|
|
print_length(<<_/bitstring>> = Bin, D, T, RF, Enc, Str) -> |
|
|
|
D1 = D - 1, |
|
|
|
case |
|
|
|
Str andalso |
|
|
|
(bit_size(Bin) rem 8) =:= 0 andalso |
|
|
|
printable_bin0(Bin, D1, tsub(T, 6), Enc) |
|
|
|
of |
|
|
|
Str andalso (bit_size(Bin) rem 8) =:= 0 andalso printable_bin0(Bin, D1, tsub(T, 6), Enc) of |
|
|
|
{true, List} when is_list(List) -> |
|
|
|
S = io_lib:write_string(List, $"), %" |
|
|
|
{[$<, $<, S, $>, $>], 4 + length(S), 0, no_more}; |
|
|
|