Skip to content

Commit d2cb363

Browse files
azizkprincemaple
authored andcommitted
Elixir: fix: recognize %@module{} and %^@module{}
1 parent 9e7314a commit d2cb363

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

syntaxes/Elixir.sublime-syntax

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,6 +2280,11 @@ contexts:
22802280
- match: (?=unquote\()
22812281
set: [map_unquote_meta_pop, arguments_pop, unquote_pop]
22822282
- include: alias_names
2283+
- match: (@)({{identifier}}(?=\s*{))
2284+
captures:
2285+
1: keyword.operator.attribute.elixir
2286+
2: variable.other.constant.elixir
2287+
set: map_body_pop
22832288
- match: \^
22842289
scope: keyword.operator.pin.elixir
22852290
- match: ((?=_)(?<!%>){{identifier}})|({{identifier}})

tests/syntax_test_misc.ex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@
1111
%_{}
1212
# ^ punctuation.section.mapping.end
1313
# ^ variable.other.unused
14+
#^ punctuation.section.mapping.begin
15+
%@module{}
16+
# ^ punctuation.section.mapping.end
17+
# ^ punctuation.section.mapping.begin
18+
# ^^^^^^ variable.other.constant
19+
# ^ keyword.operator.attribute.elixir
20+
#^ punctuation.section.mapping.begin
21+
%^@module{}
22+
# ^ punctuation.section.mapping.end
23+
# ^ punctuation.section.mapping.begin
24+
# ^^^^^^ variable.other.constant
25+
# ^ keyword.operator.attribute.elixir
26+
# ^ keyword.operator.pin.elixir
1427
#^ punctuation.section.mapping.begin
1528
%{%{}: :%{}}."%{}"
1629
# ^^^ variable.other.member

0 commit comments

Comments
 (0)