aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2014-02-11 15:00:58 +0100
committerHenrik Nord <[email protected]>2014-02-11 15:01:01 +0100
commit2079ea9e1c41b2579bc08fa1bfc53179dab50ead (patch)
tree69868512b77b0e425af82dd101e34d701829faee /lib/stdlib/src
parent264c63ecc5d6409e0498994b58eab84debbca00d (diff)
parentdfb4ec804a099b539c91e5643090d8183885e71c (diff)
downloadotp-2079ea9e1c41b2579bc08fa1bfc53179dab50ead.tar.gz
otp-2079ea9e1c41b2579bc08fa1bfc53179dab50ead.tar.bz2
otp-2079ea9e1c41b2579bc08fa1bfc53179dab50ead.zip
Merge branch 'fenollp/shell-expand-0arity-completely'
* fenollp/shell-expand-0arity-completely: Shell: expand 0-arity functions all the way to closing parenthesis OTP-11684
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/edlin_expand.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/stdlib/src/edlin_expand.erl b/lib/stdlib/src/edlin_expand.erl
index 516c0aa30b..0033010dce 100644
--- a/lib/stdlib/src/edlin_expand.erl
+++ b/lib/stdlib/src/edlin_expand.erl
@@ -89,7 +89,13 @@ match(Prefix, Alts, Extra) ->
{yes, Remain, []}
end;
{complete, Str} ->
- {yes, nthtail(Len, Str) ++ Extra, []};
+ {_, Arity} = lists:keyfind(Str, 1, Matches),
+ case {Arity, Extra} of
+ {0, "("} ->
+ {yes, nthtail(Len, Str) ++ "()", []};
+ _ ->
+ {yes, nthtail(Len, Str) ++ Extra, []}
+ end;
no ->
{no, [], []}
end.