aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-02-19 10:30:35 +0100
committerFredrik Gustafsson <[email protected]>2013-02-19 10:30:35 +0100
commit7ebb2ae46e21946aa13ef815628a156be42f0927 (patch)
tree52ee3e4a2520af722b91fd8dd5a6e38534a9032c /lib/hipe
parent75c2ab3d601e8e514733f50eba702be5cc893e44 (diff)
parent5900758f7bc5727a68a575459f50e6c5a0dd2514 (diff)
downloadotp-7ebb2ae46e21946aa13ef815628a156be42f0927.tar.gz
otp-7ebb2ae46e21946aa13ef815628a156be42f0927.tar.bz2
otp-7ebb2ae46e21946aa13ef815628a156be42f0927.zip
Merge branch 'ks/type-doc-cleanup/OTP-10850'
* ks/type-doc-cleanup/OTP-10850: Add support for printing <<_:_*1>> as bitstring() Clean up of documentation of type language
Diffstat (limited to 'lib/hipe')
-rw-r--r--lib/hipe/cerl/erl_types.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl
index 532b2e43cd..b1a41cd816 100644
--- a/lib/hipe/cerl/erl_types.erl
+++ b/lib/hipe/cerl/erl_types.erl
@@ -3241,6 +3241,8 @@ t_to_string(?bitstr(0, 0), _RecDict) ->
"<<>>";
t_to_string(?bitstr(8, 0), _RecDict) ->
"binary()";
+t_to_string(?bitstr(1, 0), _RecDict) ->
+ "bitstring()";
t_to_string(?bitstr(0, B), _RecDict) ->
lists:flatten(io_lib:format("<<_:~w>>", [B]));
t_to_string(?bitstr(U, 0), _RecDict) ->
@@ -3870,12 +3872,14 @@ t_form_to_string({type, _L, binary, [Base, Unit]} = Type) ->
case {U, B} of
{0, 0} -> "<<>>";
{8, 0} -> "binary()";
+ {1, 0} -> "bitstring()";
{0, B} -> lists:flatten(io_lib:format("<<_:~w>>", [B]));
{U, 0} -> lists:flatten(io_lib:format("<<_:_*~w>>", [U]));
{U, B} -> lists:flatten(io_lib:format("<<_:~w,_:_*~w>>", [B, U]))
end;
_ -> io_lib:format("Badly formed bitstr type ~w", [Type])
end;
+t_form_to_string({type, _L, bitstring, []}) -> "bitstring()";
t_form_to_string({type, _L, 'fun', []}) -> "fun()";
t_form_to_string({type, _L, 'fun', [{type, _, any}, Range]}) ->
"fun(...) -> " ++ t_form_to_string(Range);