Skip to content

Commit 7ca8126

Browse files
azizkprincemaple
authored andcommitted
Elixir: recognize defmacro (..) do end
1 parent f841204 commit 7ca8126

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

syntaxes/Elixir.sublime-syntax

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ contexts:
196196
scope: entity.name.function.elixir
197197
set: function_free_form_header_pop
198198
199+
- match: (\()\s*(\.\.)\s*(\))
200+
captures:
201+
1: punctuation.section.group.begin.elixr
202+
2: entity.name.function.elixir
203+
3: punctuation.section.group.end.elixr
204+
set: function_free_form_header_pop
205+
199206
- include: atom_keyword
200207
- include: func_do_block_pop
201208
- include: block_or_keyword

tests/syntax_test_declarations.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,10 @@ def .. a do a end
403403
def ..(a) do a end
404404
# ^ punctuation.section.group.begin
405405
# ^^ keyword.operator.range
406+
defmacro (..) do range(__CALLER__.context, 0, -1, 1) end
407+
# ^ punctuation.section.group.end
408+
# ^^ entity.name.function
409+
# ^ punctuation.section.group.begin
406410
def ... a do a end
407411
# ^^^ entity.name.function
408412
def ...(a) do a end

0 commit comments

Comments
 (0)