aboutsummaryrefslogtreecommitdiffstats
path: root/lib/syntax_tools/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2018-09-14 09:48:32 +0200
committerHans Bolinder <[email protected]>2018-09-14 09:48:32 +0200
commit51dcd166c58bf371da4c85250c8d76c27b4148da (patch)
tree4199e5a61b71ce7ee8d50ed0e72caee32eb03de4 /lib/syntax_tools/src
parent6dcaba3b6ae75af4c35aff01fab7bbc777d2bba7 (diff)
parent8856bfa8d104b700d67180c15eff98003d28e075 (diff)
downloadotp-51dcd166c58bf371da4c85250c8d76c27b4148da.tar.gz
otp-51dcd166c58bf371da4c85250c8d76c27b4148da.tar.bz2
otp-51dcd166c58bf371da4c85250c8d76c27b4148da.zip
Merge branch 'hasse/syntax_tools/fix_revert/OTP-15294' into maint
* hasse/syntax_tools/fix_revert/OTP-15294: erts: Add comment about [] and nil() to The Abstract Format syntax_tools: Correct erl_syntax:revert/1
Diffstat (limited to 'lib/syntax_tools/src')
-rw-r--r--lib/syntax_tools/src/erl_syntax.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/syntax_tools/src/erl_syntax.erl b/lib/syntax_tools/src/erl_syntax.erl
index 331081a07e..1be644c620 100644
--- a/lib/syntax_tools/src/erl_syntax.erl
+++ b/lib/syntax_tools/src/erl_syntax.erl
@@ -5455,8 +5455,12 @@ map_type(Fields) ->
revert_map_type(Node) ->
Pos = get_pos(Node),
- {type, Pos, map, map_type_fields(Node)}.
-
+ case map_type_fields(Node) of
+ any_size ->
+ {type, Pos, map, any};
+ Fields ->
+ {type, Pos, map, Fields}
+ end.
%% =====================================================================
%% @doc Returns the list of field subtrees of a `map_type' node.
@@ -5714,7 +5718,12 @@ tuple_type(Elements) ->
revert_tuple_type(Node) ->
Pos = get_pos(Node),
- {type, Pos, tuple, tuple_type_elements(Node)}.
+ case tuple_type_elements(Node) of
+ any_size ->
+ {type, Pos, tuple, any};
+ TypeElements ->
+ {type, Pos, tuple, TypeElements}
+ end.
%% =====================================================================