Skip to content

Commit 5001421

Browse files
azizkprincemaple
authored andcommitted
Elixir: more correct regex for module_name.
1 parent 7a9ed7d commit 5001421

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

syntaxes/Elixir.sublime-syntax

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ authors:
1717
- José Valim <[email protected]>
1818

1919
variables:
20-
module_name: '[A-Z][a-zA-Z\d_]*\b'
20+
module_name: '[A-Z][a-zA-Z\d_]*+'
2121
atom_id_suffix: '[\w@]*[?!]?'
2222
atom_id: (?>[[:alpha:]_]{{atom_id_suffix}})
2323
identifier: (?>[[:lower:]_]\w*[?!]?)
@@ -594,7 +594,7 @@ contexts:
594594
- match: (?=unquote\()
595595
set: [map_type_body_pop, arguments_pop, unquote_pop]
596596
- include: alias_names
597-
- match: _(?:{{module_name}}|{{identifier}})?
597+
- match: _(?>{{module_name}}|{{identifier}})?
598598
scope: variable.type.unused.elixir invalid.illegal.struct.elixir
599599
set: map_type_body_pop
600600
- include: map_type_body_pop
@@ -1485,7 +1485,7 @@ contexts:
14851485
- match: (?={{atom_symbol}}:(?!:))|(?<=["']:)
14861486
push: arguments_ws_rest_pop
14871487
- include: block_or_keyword
1488-
- match: (?=(?>(?<=%>)\.)?(?>{{module_name}}{{no_key_suffix}}|__MODULE__{{no_id_key_suffix}})|:(?>{{atom_symbol}}|['"]))
1488+
- match: (?=(?:(?<=%>)\.)?(?>{{module_name}}{{no_key_suffix}}|__MODULE__{{no_id_key_suffix}})|:(?>{{atom_symbol}}|['"]))
14891489
push:
14901490
- meta_scope: meta.namespace.elixir
14911491
- match: (:)({{atom_symbol}})(?!\s*\.)
@@ -2127,7 +2127,7 @@ contexts:
21272127
- include: if_non_space_or_eol_pop
21282128

21292129
alias_names:
2130-
- match: (?=(?>(?<=%>)\.)?(?>{{module_name}}{{no_key_suffix}}|__MODULE__{{no_id_key_suffix}})|:(?>{{atom_symbol}}|['"]))
2130+
- match: (?=(?:(?<=%>)\.)?(?>{{module_name}}{{no_key_suffix}}|__MODULE__{{no_id_key_suffix}})|:(?>{{atom_symbol}}|['"]))
21312131
push:
21322132
- include: module_name
21332133
- include: dot_accessor

0 commit comments

Comments
 (0)