Closed fishcakez closed 11 years ago
Thanks, I can reproduce it, I will investigate it.
Also when used in a case:
eval(Fun, Arg) ->
case handle_result(Fun(Arg)) of
true ->
true
end.
This is indeed a bug in indent.erl
.
The bug is caused by the fact that I use ==
to check whether the current token is fun
– but it turns out, if the 'ignorecase'
option is turned on, ==
is case insensitive, i.e. "fun" == "Fun"
is true, so indent.erl
believes that Fun(Arg)
is the beginning of an anonymous function definition. The solution is to use the ==#
operator which is always case sensitive.
We have a similar problem with the searchpair
function – here the solution is to add \C
to the pattern (which means "be case sensitive").
Example: