diff options
author | Micael Karlberg <[email protected]> | 2011-11-07 16:13:30 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-11-07 16:13:30 +0100 |
commit | 8149b970814848dc404767d5635529c61cf20b24 (patch) | |
tree | b829c0cf811b6f230653b75433d01657017c62c7 /lib/stdlib/src/erl_pp.erl | |
parent | 55ae4936f1afabc4475139d7d46d655b61e06b3b (diff) | |
parent | 2c18949bf1edfda523ae15229e94a8400bb1870c (diff) | |
download | otp-8149b970814848dc404767d5635529c61cf20b24.tar.gz otp-8149b970814848dc404767d5635529c61cf20b24.tar.bz2 otp-8149b970814848dc404767d5635529c61cf20b24.zip |
Merge branch 'master' of super:otp into bmk/megaco/r15_integration
Diffstat (limited to 'lib/stdlib/src/erl_pp.erl')
-rw-r--r-- | lib/stdlib/src/erl_pp.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/stdlib/src/erl_pp.erl b/lib/stdlib/src/erl_pp.erl index 7dc19f2e9b..6b5aa951cf 100644 --- a/lib/stdlib/src/erl_pp.erl +++ b/lib/stdlib/src/erl_pp.erl @@ -457,8 +457,16 @@ lexpr({'fun',_,{function,F,A}}, _Prec, _Hook) -> leaf(format("fun ~w/~w", [F,A])); lexpr({'fun',_,{function,F,A},Extra}, _Prec, _Hook) -> {force_nl,fun_info(Extra),leaf(format("fun ~w/~w", [F,A]))}; -lexpr({'fun',_,{function,M,F,A}}, _Prec, _Hook) -> +lexpr({'fun',_,{function,M,F,A}}, _Prec, _Hook) + when is_atom(M), is_atom(F), is_integer(A) -> + %% For backward compatibility with pre-R15 abstract format. leaf(format("fun ~w:~w/~w", [M,F,A])); +lexpr({'fun',_,{function,M,F,A}}, _Prec, Hook) -> + %% New format in R15. + NameItem = lexpr(M, Hook), + CallItem = lexpr(F, Hook), + ArityItem = lexpr(A, Hook), + ["fun ",NameItem,$:,CallItem,$/,ArityItem]; lexpr({'fun',_,{clauses,Cs}}, _Prec, Hook) -> {list,[{first,'fun',fun_clauses(Cs, Hook)},'end']}; lexpr({'fun',_,{clauses,Cs},Extra}, _Prec, Hook) -> |