Skip to content

Commit 45eb494

Browse files
committed
Elixir: removed Elixir (EEx) file; added workaround for eex tags.
1 parent f95723c commit 45eb494

File tree

2 files changed

+24
-36
lines changed

2 files changed

+24
-36
lines changed

Elixir (EEx).sublime-syntax

-33
This file was deleted.

Elixir.sublime-syntax

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
%YAML 1.2
22
---
3-
version: 2
43
# http://www.sublimetext.com/docs/3/syntax.html
54
name: Elixir
65
scope: source.elixir
7-
file_extensions: [ex, exs]
6+
file_extensions: [ex, exs, ex.eex, exs.eex]
87
first_line_match: ^#!\s*/.*\b(?:elixirc?|iex)
98
authors:
109
# Contributed several times and later on finished a complete rewrite with lots of new features.
@@ -64,6 +63,8 @@ contexts:
6463
prototype:
6564
# NB: rules in the prototype context will always match before any other.
6665
- include: merge_conflict # Merge conflict markers can occur anywhere.
66+
- include: eex_tag
67+
- include: eex_end_tag
6768

6869
core_syntax:
6970
# The rules are approximately ordered by their likeliness of occurrence
@@ -112,7 +113,27 @@ contexts:
112113
6: comment.line.incoming.git.conflict
113114
pop: true
114115

115-
## Functions
116+
# Use prototype as a workaround to the "context sanity limit" error.
117+
# An issue that remains is that "<% ... %>" embeds are not independent
118+
# of the surroundings.
119+
eex_tag:
120+
- match: (<)(%(?>%=?|[=/|]?))
121+
scope: source.elixir.eex
122+
captures:
123+
1: punctuation.section.embedded.begin.ex.eex
124+
2: entity.name.tag.ex.eex
125+
# NB: causes "context sanity limit" error.
126+
# push: core_syntax
127+
# with_prototype:
128+
# - match: (?=%>|<%)
129+
# pop: true
130+
131+
eex_end_tag:
132+
- match: \s*(%)(>)
133+
scope: source.elixir.eex
134+
captures:
135+
1: entity.name.tag.ex.eex
136+
2: punctuation.section.embedded.end.ex.eex
116137

117138
fn_block:
118139
- match: fn{{no_id_key_suffix}}

0 commit comments

Comments
 (0)