Skip to content

Commit ee83cef

Browse files
azizkprincemaple
authored andcommitted
Elixir: fix: spell out rules for ~R with [/|"'] delimiters.
1 parent 911d071 commit ee83cef

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

Elixir.sublime-syntax

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -427,19 +427,50 @@ contexts:
427427
- include: heredoc_regex_raw
428428
- match: ''
429429
set: string_modifiers_and_pop
430-
- match: (?=[/|"'])
430+
- match: \"
431+
scope: punctuation.definition.string.begin.elixir
431432
set:
432-
- meta_scope: meta.string.elixir
433-
# (?<=R) avoids matching again after the closing delimiter. E.g.: ~R||//
434-
- match: (?<=R)([/|"'])
435-
scope: string.quoted.other.literal.upper.elixir punctuation.definition.string.begin.elixir
436-
embed_scope: string.quoted.other.literal.upper.elixir
437-
embed: regex_elixir
438-
escape: \1
439-
escape_captures:
440-
0: meta.string.elixir string.quoted.other.literal.upper.elixir punctuation.definition.string.end.elixir
433+
- meta_scope: meta.string.elixir string.quoted.other.literal.regex.elixir
434+
- match: \"
435+
set: string_modifiers_and_pop
441436
- match: ''
437+
push: regex_elixir
438+
with_prototype:
439+
- match: (?=")
440+
pop: true
441+
- match: \'
442+
scope: punctuation.definition.string.begin.elixir
443+
set:
444+
- meta_scope: meta.string.elixir string.quoted.other.literal.regex.elixir
445+
- match: \'
442446
set: string_modifiers_and_pop
447+
- match: ''
448+
push: regex_elixir
449+
with_prototype:
450+
- match: (?=')
451+
pop: true
452+
- match: /
453+
scope: punctuation.definition.string.begin.elixir
454+
set:
455+
- meta_scope: meta.string.elixir string.quoted.other.literal.regex.elixir
456+
- match: /
457+
set: string_modifiers_and_pop
458+
- match: ''
459+
push: regex_elixir
460+
with_prototype:
461+
- match: (?=/)
462+
pop: true
463+
- match: \|
464+
scope: punctuation.definition.string.begin.elixir
465+
set:
466+
- meta_scope: meta.string.elixir string.quoted.other.literal.regex.elixir
467+
- match: \|
468+
set: string_modifiers_and_pop
469+
- match: ''
470+
push: regex_elixir
471+
with_prototype:
472+
- match: (?=\|)
473+
pop: true
443474
- match: \{
444475
scope: punctuation.definition.string.begin.elixir
445476
set:

0 commit comments

Comments
 (0)