aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-02-07 12:11:14 +0100
committerBjörn Gustavsson <[email protected]>2014-02-07 12:11:14 +0100
commitd9283db0943ec94d737a28e31fdb63feb08a8e00 (patch)
tree8f178e8ce1a68850d7ced18d58306337c1ecb608
parent75c490066bd84f531eea8fed118540a358042812 (diff)
parent52f88fc986a6ad4985cc0343ccc034ab3bd693fa (diff)
downloadotp-d9283db0943ec94d737a28e31fdb63feb08a8e00.tar.gz
otp-d9283db0943ec94d737a28e31fdb63feb08a8e00.tar.bz2
otp-d9283db0943ec94d737a28e31fdb63feb08a8e00.zip
Merge branch 'nox/eep37/OTP-11537'
* nox/eep37/OTP-11537: Support named funs in erl_prettypr
-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 4d6e88f58b..877675772f 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),