diff options
author | Hans Bolinder <[email protected]> | 2019-08-26 08:10:43 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2019-08-26 08:10:43 +0200 |
commit | dcc3ff74d5932a1aadd39ddf91cb480ff122da7b (patch) | |
tree | 09cafc19785e5921faaebef70087153875e2afe9 /lib/syntax_tools/src | |
parent | a7c5d6c80d6879cb1c67b60632ac31c5459c26d4 (diff) | |
parent | 19697637a41f7e5199f017abae44bac5e7367c57 (diff) | |
download | otp-dcc3ff74d5932a1aadd39ddf91cb480ff122da7b.tar.gz otp-dcc3ff74d5932a1aadd39ddf91cb480ff122da7b.tar.bz2 otp-dcc3ff74d5932a1aadd39ddf91cb480ff122da7b.zip |
Merge branch 'zadean/syntax_tools/add_missing_unwrap/OTP-16012/PR-2348' into maint
* zadean/syntax_tools/add_missing_unwrap/OTP-16012/PR-2348:
Update test suite
Also unwrap map_type_* name and value
Add unwrap calls to map_field_* in erl_syntax
Diffstat (limited to 'lib/syntax_tools/src')
-rw-r--r-- | lib/syntax_tools/src/erl_syntax.erl | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/lib/syntax_tools/src/erl_syntax.erl b/lib/syntax_tools/src/erl_syntax.erl index 1be644c620..09ef0bf7a5 100644 --- a/lib/syntax_tools/src/erl_syntax.erl +++ b/lib/syntax_tools/src/erl_syntax.erl @@ -2192,11 +2192,11 @@ revert_map_field_assoc(Node) -> -spec map_field_assoc_name(syntaxTree()) -> syntaxTree(). map_field_assoc_name(Node) -> - case Node of + case unwrap(Node) of {map_field_assoc, _, Name, _} -> Name; - _ -> - (data(Node))#map_field_assoc.name + Node1 -> + (data(Node1))#map_field_assoc.name end. @@ -2208,11 +2208,11 @@ map_field_assoc_name(Node) -> -spec map_field_assoc_value(syntaxTree()) -> syntaxTree(). map_field_assoc_value(Node) -> - case Node of + case unwrap(Node) of {map_field_assoc, _, _, Value} -> Value; - _ -> - (data(Node))#map_field_assoc.value + Node1 -> + (data(Node1))#map_field_assoc.value end. @@ -2250,11 +2250,11 @@ revert_map_field_exact(Node) -> -spec map_field_exact_name(syntaxTree()) -> syntaxTree(). map_field_exact_name(Node) -> - case Node of + case unwrap(Node) of {map_field_exact, _, Name, _} -> Name; - _ -> - (data(Node))#map_field_exact.name + Node1 -> + (data(Node1))#map_field_exact.name end. @@ -2266,11 +2266,11 @@ map_field_exact_name(Node) -> -spec map_field_exact_value(syntaxTree()) -> syntaxTree(). map_field_exact_value(Node) -> - case Node of + case unwrap(Node) of {map_field_exact, _, _, Value} -> Value; - _ -> - (data(Node))#map_field_exact.value + Node1 -> + (data(Node1))#map_field_exact.value end. @@ -5339,11 +5339,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. @@ -5355,11 +5355,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. @@ -5397,11 +5397,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. @@ -5413,11 +5413,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. |