From 98462d8ec91dc34a06f5a2801c906ca1a0dd4ba1 Mon Sep 17 00:00:00 2001 From: zadean Date: Mon, 19 Aug 2019 14:35:53 +0200 Subject: Also unwrap map_type_* name and value --- lib/syntax_tools/src/erl_syntax.erl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/syntax_tools/src/erl_syntax.erl b/lib/syntax_tools/src/erl_syntax.erl index 385094d5bd..eeb9bc20ab 100644 --- a/lib/syntax_tools/src/erl_syntax.erl +++ b/lib/syntax_tools/src/erl_syntax.erl @@ -5311,11 +5311,11 @@ revert_map_type_assoc(Node) -> -spec map_type_assoc_name(syntaxTree()) -> syntaxTree(). map_type_assoc_name(Node) -> - case Node of + case unwrap(Node) of {type, _, map_field_assoc, [Name, _]} -> Name; - _ -> - (data(Node))#map_type_assoc.name + Node1 -> + (data(Node1))#map_type_assoc.name end. @@ -5327,11 +5327,11 @@ map_type_assoc_name(Node) -> -spec map_type_assoc_value(syntaxTree()) -> syntaxTree(). map_type_assoc_value(Node) -> - case Node of + case unwrap(Node) of {type, _, map_field_assoc, [_, Value]} -> Value; - _ -> - (data(Node))#map_type_assoc.value + Node1 -> + (data(Node1))#map_type_assoc.value end. @@ -5369,11 +5369,11 @@ revert_map_type_exact(Node) -> -spec map_type_exact_name(syntaxTree()) -> syntaxTree(). map_type_exact_name(Node) -> - case Node of + case unwrap(Node) of {type, _, map_field_exact, [Name, _]} -> Name; - _ -> - (data(Node))#map_type_exact.name + Node1 -> + (data(Node1))#map_type_exact.name end. @@ -5385,11 +5385,11 @@ map_type_exact_name(Node) -> -spec map_type_exact_value(syntaxTree()) -> syntaxTree(). map_type_exact_value(Node) -> - case Node of + case unwrap(Node) of {type, _, map_field_exact, [_, Value]} -> Value; - _ -> - (data(Node))#map_type_exact.value + Node1 -> + (data(Node1))#map_type_exact.value end. -- cgit v1.2.3