aboutsummaryrefslogtreecommitdiffstats
path: root/lib/syntax_tools
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2014-02-01 04:03:32 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2014-02-01 04:03:32 +0100
commit52f88fc986a6ad4985cc0343ccc034ab3bd693fa (patch)
treeb8b2eb34e5ee1c5135b3a49b47723b791a4baf81 /lib/syntax_tools
parenteec1d22c5aef21ad4606c79465084bbff46d42ee (diff)
downloadotp-52f88fc986a6ad4985cc0343ccc034ab3bd693fa.tar.gz
otp-52f88fc986a6ad4985cc0343ccc034ab3bd693fa.tar.bz2
otp-52f88fc986a6ad4985cc0343ccc034ab3bd693fa.zip
Support named funs in erl_prettypr
Diffstat (limited to 'lib/syntax_tools')
-rw-r--r--lib/syntax_tools/src/erl_prettypr.erl8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/syntax_tools/src/erl_prettypr.erl b/lib/syntax_tools/src/erl_prettypr.erl
index 1ffcf31134..563fd36fdf 100644
--- a/lib/syntax_tools/src/erl_prettypr.erl
+++ b/lib/syntax_tools/src/erl_prettypr.erl
@@ -637,6 +637,14 @@ lay_2(Node, Ctxt) ->
sep([follow(text("fun"), D, Ctxt1#ctxt.sub_indent),
text("end")]);
+ named_fun_expr ->
+ Ctxt1 = reset_prec(Ctxt),
+ D1 = lay(erl_syntax:named_fun_expr_name(Node), Ctxt1),
+ D = lay_clauses(erl_syntax:named_fun_expr_clauses(Node),
+ {function,D1}, Ctxt1),
+ sep([follow(text("fun"), D, Ctxt1#ctxt.sub_indent),
+ text("end")]);
+
module_qualifier ->
{PrecL, _Prec, PrecR} = inop_prec(':'),
D1 = lay(erl_syntax:module_qualifier_argument(Node),