diff options
author | Björn-Egil Dahlberg <[email protected]> | 2013-10-24 21:17:11 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-01-28 17:06:41 +0100 |
commit | b42453915e4c6aa1133e88c06a60dfbc5fe5e1f0 (patch) | |
tree | 7b551c7584bc56b706a47a1d610e9cb3e176e9f3 /lib/edoc/src/edoc_layout.erl | |
parent | 351987be44e11e6eb9e5841adb197ec8e49bc49d (diff) | |
download | otp-b42453915e4c6aa1133e88c06a60dfbc5fe5e1f0.tar.gz otp-b42453915e4c6aa1133e88c06a60dfbc5fe5e1f0.tar.bz2 otp-b42453915e4c6aa1133e88c06a60dfbc5fe5e1f0.zip |
edoc,syntax_tools: Teach Map understanding
Diffstat (limited to 'lib/edoc/src/edoc_layout.erl')
-rw-r--r-- | lib/edoc/src/edoc_layout.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/edoc/src/edoc_layout.erl b/lib/edoc/src/edoc_layout.erl index 7bd0615f5c..e164ff060f 100644 --- a/lib/edoc/src/edoc_layout.erl +++ b/lib/edoc/src/edoc_layout.erl @@ -829,6 +829,10 @@ t_type([#xmlElement{name = list, content = Es}]) -> t_list(Es); t_type([#xmlElement{name = nonempty_list, content = Es}]) -> t_nonempty_list(Es); +t_type([#xmlElement{name = map, content = Es}]) -> + t_map(Es); +t_type([#xmlElement{name = map_field, content=Es}]) -> + t_map_field(Es); t_type([#xmlElement{name = tuple, content = Es}]) -> t_tuple(Es); t_type([#xmlElement{name = 'fun', content = Es}]) -> @@ -877,6 +881,12 @@ t_fun(Es) -> ["("] ++ seq(fun t_utype_elem/1, get_content(argtypes, Es), [") -> "] ++ t_utype(get_elem(type, Es))). +t_map(Es) -> + ["#{"] ++ seq(fun t_utype_elem/1, Es, ["}"]). + +t_map_field([K,V]) -> + [t_utype_elem(K) ++ " => " ++ t_utype_elem(V)]. + t_record(E, Es) -> Name = ["#"] ++ t_type(get_elem(atom, Es)), case get_elem(field, Es) of |