diff options
author | Steve Vinoski <[email protected]> | 2013-09-11 06:44:27 -0400 |
---|---|---|
committer | Anthony Ramine <[email protected]> | 2013-12-12 12:54:25 +0100 |
commit | 4df233adc5a1d5ab54d3c7419a463ae1ef417c12 (patch) | |
tree | 450e6744f997d17f01306baeac6eee81db7203c5 /lib/tools/emacs/test.erl.indented | |
parent | a929df291877df45c93303d22995bbbebf6a2c45 (diff) | |
download | otp-4df233adc5a1d5ab54d3c7419a463ae1ef417c12.tar.gz otp-4df233adc5a1d5ab54d3c7419a463ae1ef417c12.tar.bz2 otp-4df233adc5a1d5ab54d3c7419a463ae1ef417c12.zip |
Support EEP37 named funs in emacs erlang-mode
Change emacs erlang-mode to recognize EEP37 named funs so they're indented
properly. Specifically, modify erlang-partial-parse to allow for an
optional Erlang variable name to appear between the "fun" keyword and the
opening parenthesis of its argument list.
Diffstat (limited to 'lib/tools/emacs/test.erl.indented')
-rw-r--r-- | lib/tools/emacs/test.erl.indented | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/tools/emacs/test.erl.indented b/lib/tools/emacs/test.erl.indented index 7e61bcc45b..0de626125c 100644 --- a/lib/tools/emacs/test.erl.indented +++ b/lib/tools/emacs/test.erl.indented @@ -483,6 +483,19 @@ indent_fun() -> Y = true andalso kalle end), + %% check EEP37 named funs + Fn1 = fun Fact(N) when N > 0 -> + F = Fact(N-1), + N * F; + Fact(0) -> + 1 + end, + %% check anonymous funs too + Fn2 = fun(0) -> + 1; + (N) -> + N + end, ok. indent_try_catch() -> |