aboutsummaryrefslogtreecommitdiffstats
path: root/lib/syntax_tools/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2018-09-14 09:50:51 +0200
committerHans Bolinder <[email protected]>2018-09-14 09:50:51 +0200
commit0348488330332df56d9a9279a1e3555f9ba876af (patch)
tree7f2c4df04cfc1b6f9ba076a26aa9da9eaa8e0ee0 /lib/syntax_tools/src
parentddf5ada347f3ed287524c440a6786d28e40e8144 (diff)
parent51dcd166c58bf371da4c85250c8d76c27b4148da (diff)
downloadotp-0348488330332df56d9a9279a1e3555f9ba876af.tar.gz
otp-0348488330332df56d9a9279a1e3555f9ba876af.tar.bz2
otp-0348488330332df56d9a9279a1e3555f9ba876af.zip
Merge branch 'maint'
* maint: 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.
%% =====================================================================