Skip to content

Commit 2cd9592

Browse files
azizkprincemaple
authored andcommitted
Elixir: fix: only consider first argument in defmodule
1 parent c782be8 commit 2cd9592

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

syntaxes/Elixir.sublime-syntax

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,9 +1740,10 @@ contexts:
17401740
- include: unquote_call
17411741
- include: dot_operator
17421742
- include: if_non_space_or_eol_pop
1743-
- include: arg_comma_and_skip_ws
1743+
- match: (?=,)
1744+
push: arguments_ws_rest_pop
17441745
- include: last_id_argument
1745-
- include: core_syntax_or_if_closing_pop
1746+
- include: core_syntax
17461747

17471748
defrecord:
17481749
- match: (?:(Record)\s*(\.)\s*)?(defrecordp?){{no_suffix_then_arguments}}

tests/syntax_test_declarations.ex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ defmodule :App.:Module
5858
# ^ punctuation.accessor
5959
# ^^^ constant.other.module
6060
# ^ punctuation.definition.constant.begin
61+
defmodule Module, NotAModule
62+
# ^^^^^^^^^^^^^^ -entity.name.namespace
63+
# ^ punctuation.separator.arguments
64+
defmodule(Module, NotAModule)
65+
# ^^^^^^^^^^^^^^ -entity.name.namespace
66+
# ^ punctuation.separator.arguments
67+
defmodule Module, compile? do end
68+
# ^^^^^^^^ variable.other
69+
# ^ punctuation.separator.arguments
70+
defmodule(Module, compile? do end)
71+
# ^^^^^^^^ variable.other
72+
# ^ punctuation.separator.arguments
6173
defmodule :<<>>
6274
# ^^^^ entity.name.namespace
6375
defmodule :&&, do: def(a &&& b, do: a && b); :&&.&&&(:&, :&)

0 commit comments

Comments
 (0)