diff options
author | Hans Bolinder <[email protected]> | 2017-03-29 15:48:27 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2017-04-07 08:57:27 +0200 |
commit | 15a631cb2ec70860bc58492020904b1b16fed5c4 (patch) | |
tree | 7421baad6b9bfcb6670984721ec0ab49273bdbc3 /lib/edoc/src/edoc_extract.erl | |
parent | 9c013d50cc5abf3b0a0dbb5fc2be97c825bc0261 (diff) | |
download | otp-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_extract.erl')
-rw-r--r-- | lib/edoc/src/edoc_extract.erl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/edoc/src/edoc_extract.erl b/lib/edoc/src/edoc_extract.erl index 68edad1a3e..390851e9ef 100644 --- a/lib/edoc/src/edoc_extract.erl +++ b/lib/edoc/src/edoc_extract.erl @@ -488,8 +488,15 @@ find_names([P | Ps], Ns) -> find_names([P1 | Ps], Ns); record_expr -> A = erl_syntax:record_expr_type(P), - N = list_to_atom(capitalize(erl_syntax:atom_name(A))), - find_names(Ps, [N | Ns]); + AtomName = erl_syntax:atom_name(A), + Atom = list_to_atom(AtomName), + case AtomName =:= lists:flatten(io_lib:write_atom(Atom)) of + true -> + N = list_to_atom(capitalize(AtomName)), + find_names(Ps, [N | Ns]); + false -> + find_names(Ps, Ns) + end; infix_expr -> %% this can only be a '++' operation P1 = erl_syntax:infix_expr_right(P), @@ -540,6 +547,7 @@ tidy_name_1(Cs) -> [$_ | Cs]. %% Change initial character from lowercase to uppercase. 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. %% Collects the tags belonging to each entry, checks them, expands |