aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/erl_parse.yrl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-03-25 21:19:05 +0100
committerMicael Karlberg <[email protected]>2011-03-25 21:19:05 +0100
commit5396cae69c23d7d8b7bbd0433c3b31144254c7a9 (patch)
treea16e52267f14417155e938ee5f34cc5082efc314 /lib/stdlib/src/erl_parse.yrl
parent143cc965e88ea2486c1e6b804f2ae033e870de2d (diff)
parentf0e2f0b91ac4d45a64ddac511e0eba9b6ce01e92 (diff)
downloadotp-5396cae69c23d7d8b7bbd0433c3b31144254c7a9.tar.gz
otp-5396cae69c23d7d8b7bbd0433c3b31144254c7a9.tar.bz2
otp-5396cae69c23d7d8b7bbd0433c3b31144254c7a9.zip
Merge branch 'dev' into bmk/snmp/support_ipv6_transport_address
Diffstat (limited to 'lib/stdlib/src/erl_parse.yrl')
-rw-r--r--lib/stdlib/src/erl_parse.yrl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl
index bb4b18cf9b..15b45d72f4 100644
--- a/lib/stdlib/src/erl_parse.yrl
+++ b/lib/stdlib/src/erl_parse.yrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -757,7 +757,8 @@ record_fields([{typed,Expr,TypeInfo}|Fields]) ->
{atom, La, _} ->
case has_undefined(TypeInfo) of
false ->
- lift_unions(abstract(undefined, La), TypeInfo);
+ TypeInfo2 = maybe_add_paren(TypeInfo),
+ lift_unions(abstract(undefined, La), TypeInfo2);
true ->
TypeInfo
end
@@ -778,6 +779,11 @@ has_undefined({type,_,union,Ts}) ->
has_undefined(_) ->
false.
+maybe_add_paren({ann_type,L,T}) ->
+ {paren_type,L,[{ann_type,L,T}]};
+maybe_add_paren(T) ->
+ T.
+
term(Expr) ->
try normalise(Expr)
catch _:_R -> ret_err(?line(Expr), "bad attribute")