Skip to content

Commit a0bee93

Browse files
committed
Remove grammar clause for "fn" terminal. Fixes #7
After stepping through SMIE functions with EDebug, I realized the only actual problem in indenting blocks like these is that for the sake of the grammar, `fn` is considered an opener. I tried many ways to get this particular issue sorted out, but the simplest was just to remove that clause from the grammar.
1 parent 642ee02 commit a0bee93

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

elixir-smie.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ Return non-nil if any line breaks were skipped."
240240
("try" "do" statements "catch" match-statements "end")
241241
("try" "do" statements "end")
242242
("case" non-block-expr "do" match-statements "end")
243-
("fn" match-statement "end")
244243
("function" "do" match-statements "end")
245244
(non-block-expr "do" statements "end")
246245
(expr)

test/elixir-mode-indentation-tests.el

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,7 @@ function do
248248
end
249249
")
250250

251-
(elixir-def-indentation-test indents-fn-in-assignment
252-
(:expected-result :failed)
251+
(elixir-def-indentation-test indents-fn-in-assignment ()
253252
"
254253
f = fn x, y ->
255254
x + y
@@ -259,11 +258,10 @@ f = fn x, y ->
259258
x + y
260259
end")
261260

262-
(elixir-def-indentation-test indents-fn-as-arguments
263-
(:expected-result :failed)
261+
(elixir-def-indentation-test indents-fn-as-arguments ()
264262
"
265263
Enum.map 1..10, fn x ->
266-
x+1
264+
x + 1
267265
end"
268266
"
269267
Enum.map 1..10, fn x ->

0 commit comments

Comments
 (0)