Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Elixir] Update syntax #13

Merged
merged 1 commit into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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