From 52f88fc986a6ad4985cc0343ccc034ab3bd693fa Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 1 Feb 2014 04:03:32 +0100 Subject: Support named funs in erl_prettypr --- lib/syntax_tools/src/erl_prettypr.erl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/syntax_tools') 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), -- cgit v1.2.3