aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-06-10 08:23:26 +0200
committerHans Bolinder <[email protected]>2016-06-10 08:23:26 +0200
commit77e69343b8bf6de63242cbcea7ebb35be3bb99e9 (patch)
tree5954533b7d1221aec75067cb1a56cda6350b16a7 /lib/stdlib/src
parent68ff9f3e4b5387cf38af7aeb1a8b7abbdaa867d8 (diff)
parentaf761914c9a94a9d54c1bcc2d4fff96a58674078 (diff)
downloadotp-77e69343b8bf6de63242cbcea7ebb35be3bb99e9.tar.gz
otp-77e69343b8bf6de63242cbcea7ebb35be3bb99e9.tar.bz2
otp-77e69343b8bf6de63242cbcea7ebb35be3bb99e9.zip
Merge branch 'hasse/no_dots_in_map_types/PR-1014'
* hasse/no_dots_in_map_types/PR-1014: Remove support for '...' in Maps types
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/erl_parse.yrl3
-rw-r--r--lib/stdlib/src/erl_pp.erl20
2 files changed, 1 insertions, 22 deletions
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl
index a896de4f1c..1de09aae62 100644
--- a/lib/stdlib/src/erl_parse.yrl
+++ b/lib/stdlib/src/erl_parse.yrl
@@ -170,9 +170,6 @@ fun_type -> '(' top_types ')' '->' top_type
: {type, ?anno('$1'), 'fun',
[{type, ?anno('$1'), product, '$2'},'$5']}.
-map_pair_types -> '...' : [{type, ?anno('$1'), map_field_assoc,
- [{type, ?anno('$1'), any, []},
- {type, ?anno('$1'), any, []}]}].
map_pair_types -> map_pair_type : ['$1'].
map_pair_types -> map_pair_type ',' map_pair_types : ['$1'|'$3'].
diff --git a/lib/stdlib/src/erl_pp.erl b/lib/stdlib/src/erl_pp.erl
index ca764675fc..4009300a32 100644
--- a/lib/stdlib/src/erl_pp.erl
+++ b/lib/stdlib/src/erl_pp.erl
@@ -344,27 +344,9 @@ binary_type(I1, I2) ->
map_type(Fs) ->
{first,[$#],map_pair_types(Fs)}.
-map_pair_types(Fs0) ->
- Fs = replace_any_map(Fs0),
+map_pair_types(Fs) ->
tuple_type(Fs, fun map_pair_type/2).
-replace_any_map([{type,Line,map_field_assoc,[KType,VType]}]=Fs) ->
- IsAny = fun({type,_,any,[]}) -> true;
- %% ({var,_,'_'}) -> true;
- (_) -> false
- end,
- case IsAny(KType) andalso IsAny(VType) of
- true ->
- [{type,Line,map_field_assoc,any}];
- false ->
- Fs
- end;
-replace_any_map([F|Fs]) ->
- [F|replace_any_map(Fs)];
-replace_any_map([]) -> [].
-
-map_pair_type({type,_Line,map_field_assoc,any}, _Prec) ->
- leaf("...");
map_pair_type({type,_Line,map_field_assoc,[KType,VType]}, Prec) ->
{list,[{cstep,[ltype(KType, Prec),leaf(" =>")],ltype(VType, Prec)}]};
map_pair_type({type,_Line,map_field_exact,[KType,VType]}, Prec) ->