aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edoc/src/edoc_specs.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-03-29 15:48:27 +0200
committerHans Bolinder <[email protected]>2017-04-07 08:57:27 +0200
commit15a631cb2ec70860bc58492020904b1b16fed5c4 (patch)
tree7421baad6b9bfcb6670984721ec0ab49273bdbc3 /lib/edoc/src/edoc_specs.erl
parent9c013d50cc5abf3b0a0dbb5fc2be97c825bc0261 (diff)
downloadotp-15a631cb2ec70860bc58492020904b1b16fed5c4.tar.gz
otp-15a631cb2ec70860bc58492020904b1b16fed5c4.tar.bz2
otp-15a631cb2ec70860bc58492020904b1b16fed5c4.zip
edoc: Fix EDoc regarding Unicode atoms
Also extended the scanner to handle the \x{...} syntax. Capitalizing now works with a few more characters.
Diffstat (limited to 'lib/edoc/src/edoc_specs.erl')
-rw-r--r--lib/edoc/src/edoc_specs.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/edoc/src/edoc_specs.erl b/lib/edoc/src/edoc_specs.erl
index c15dfd328f..fb04bfce0e 100644
--- a/lib/edoc/src/edoc_specs.erl
+++ b/lib/edoc/src/edoc_specs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -274,12 +274,19 @@ parms([A | As], [D | Ds]) ->
param(#t_paren{type = Type}, Default) ->
param(Type, Default);
-param(#t_record{name = #t_atom{val = Name}}, _Default) ->
- list_to_atom(capitalize(atom_to_list(Name)));
+param(#t_record{name = #t_atom{val = Name}}=T, Default) ->
+ AtomList = atom_to_list(Name),
+ case AtomList =:= lists:flatten(io_lib:write_atom(Name)) of
+ true ->
+ list_to_atom(capitalize(AtomList));
+ false ->
+ arg_name(?t_ann(T), Default)
+ end;
param(T, Default) ->
arg_name(?t_ann(T), Default).
capitalize([C | Cs]) when C >= $a, C =< $z -> [C - 32 | Cs];
+capitalize([C | Cs]) when C >= $\340, C =< $\376, C /= $\367 -> [C - 32 | Cs];
capitalize(Cs) -> Cs.
%% Like edoc_types:arg_name/1