diff options
author | Hans Bolinder <[email protected]> | 2011-05-05 14:22:18 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2011-05-16 13:33:08 +0200 |
commit | 38b2f44764e79a34048f686d98b6d741d18738d2 (patch) | |
tree | edc44f6a2f7a71e37cd1c18d113817a671cfe6b0 /lib/erl_docgen/src | |
parent | e375165f6421c86fb245843d787e021d5b7dd00d (diff) | |
download | otp-38b2f44764e79a34048f686d98b6d741d18738d2.tar.gz otp-38b2f44764e79a34048f686d98b6d741d18738d2.tar.bz2 otp-38b2f44764e79a34048f686d98b6d741d18738d2.zip |
Improve erl_docgen's support for Dialyzer specs and types
The support for using Dialyzer specifications and types has been
improved.
Diffstat (limited to 'lib/erl_docgen/src')
-rw-r--r-- | lib/erl_docgen/src/otp_specs.erl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/erl_docgen/src/otp_specs.erl b/lib/erl_docgen/src/otp_specs.erl index 728ddb2e6e..edb437a942 100644 --- a/lib/erl_docgen/src/otp_specs.erl +++ b/lib/erl_docgen/src/otp_specs.erl @@ -1,7 +1,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 @@ -380,6 +380,8 @@ t_type([E=#xmlElement{name = float}]) -> t_float(E); t_type([#xmlElement{name = nil}]) -> t_nil(); +t_type([#xmlElement{name = paren, content = Es}]) -> + t_paren(Es); t_type([#xmlElement{name = list, content = Es}]) -> t_list(Es); t_type([#xmlElement{name = nonempty_list, content = Es}]) -> @@ -416,6 +418,9 @@ t_float(E) -> t_nil() -> ["[]"]. +t_paren(Es) -> + ["("] ++ t_utype(get_elem(type, Es)) ++ [")"]. + t_list(Es) -> ["["] ++ t_utype(get_elem(type, Es)) ++ ["]"]. @@ -532,6 +537,8 @@ ot_type([E=#xmlElement{name = float}]) -> ot_float(E); ot_type([#xmlElement{name = nil}]) -> ot_nil(); +ot_type([#xmlElement{name = paren, content = Es}]) -> + ot_paren(Es); ot_type([#xmlElement{name = list, content = Es}]) -> ot_list(Es); ot_type([#xmlElement{name = nonempty_list, content = Es}]) -> @@ -582,6 +589,9 @@ ot_float(E) -> ot_nil() -> {nil,0}. +ot_paren(Es) -> + {paren_type,0,[ot_utype(get_elem(type, Es))]}. + ot_list(Es) -> {type,0,list,[ot_utype(get_elem(type, Es))]}. @@ -697,5 +707,7 @@ annos_type([#xmlElement{name = union, content = Es}]) -> lists:flatmap(fun annos_elem/1, Es); annos_type([E=#xmlElement{name = typevar}]) -> annos_elem(E); +annos_type([#xmlElement{name = paren, content = Es}]) -> + annos(get_elem(type, Es)); annos_type(_) -> []. |