Skip to content

Commit

Permalink
[Elixir] Update syntax (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkrutzer authored Jul 29, 2021
1 parent 6d227c6 commit 2d1058f
Show file tree
Hide file tree
Showing 7 changed files with 2,125 additions and 1,383 deletions.
80 changes: 26 additions & 54 deletions Elixir/Elixir (EEx).sublime-syntax
Original file line number Diff line number Diff line change
@@ -1,61 +1,33 @@
%YAML 1.2
---
# TODO: uncomment when on separate ST4 branch in the future.
# version: 2
version: 2
name: Elixir (EEx)
file_extensions:
- ex.eex
- exs.eex
file_extensions: [ex.eex, exs.eex]
first_line_match: ^#\s*exs?\.eex
scope: source.ex.eex
scope: source.elixir.eex
extends: Elixir.sublime-syntax

contexts:
main:
- include: core_syntax

# Commented out because ST3 complains.
# TODO: uncomment when on separate ST4 branch in the future.

# # prototype:
# core_syntax:
# - meta_prepend: true
# - include: eex

# defmodule_1st_argument:
# - meta_prepend: true
# - include: eex

# # FIXME: doesn't highlight inside doc comments yet.
# markdown_comment:
# - meta_prepend: true
# - include: eex

# simple_string:
# - meta_prepend: true
# - include: eex

# block_end_pop:
# - meta_prepend: true
# - include: eex

# module_function_call_pop:
# - meta_prepend: true
# - include: eex

# identifier_operator_call_pop:
# - meta_prepend: true
# - include: eex

# dot_accessor:
# - meta_prepend: true
# - include: eex

# eex:
# - match: <%(?>%=?|[=/|]?)
# scope: keyword.other.ex.eex punctuation.section.embedded.begin.ex.eex
# push:
# - match: '%>'
# scope: text.html.ex.eex keyword.other.ex.eex punctuation.section.embedded.end.ex.eex
# pop: true
# - include: core_syntax
# Use prototype to work around the "context sanity limit" error.
# An issue that remains is that "<% ... %>" embeds are not independent
# of the surroundings.
prototype:
- include: eex_begin_tag
- include: eex_end_tag

eex_begin_tag:
- match: (<)(%(?>%=?|[=/|]?))
captures:
1: punctuation.section.embedded.begin.ex.eex
2: entity.name.tag.ex.eex
# # NB: causes "context sanity limit" error.
# push: core_syntax
# with_prototype:
# - match: (?=%>|<%)
# pop: true

eex_end_tag:
- match: \s*(%)(>)
captures:
1: entity.name.tag.ex.eex
2: punctuation.section.embedded.end.ex.eex
Loading

0 comments on commit 2d1058f

Please sign in to comment.