Skip to content
Open
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
12 changes: 12 additions & 0 deletions Sema.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ first_line_match: '^#!.*\bsema\b'
contexts:
main:
- include: line-comment
- include: regex
- include: string
- include: quoted-expression
- include: definition
Expand Down Expand Up @@ -44,6 +45,17 @@ contexts:
# ---------------------------------------------------------------------
# STRINGS
# ---------------------------------------------------------------------
regex:
- match: '#"'
scope: punctuation.definition.string.begin.sema string.regexp.sema
push:
- meta_scope: string.regexp.sema
- match: '\\.'
scope: string.regexp.sema
- match: '"'
scope: punctuation.definition.string.end.sema string.regexp.sema
pop: true

string:
- match: '"'
scope: punctuation.definition.string.begin.sema
Expand Down
10 changes: 10 additions & 0 deletions tests/syntax_test_sema.sema
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,13 @@
;^^^^^^^^^^^^ support.function.sema
; ^^ constant.language.boolean.sema
; ^^^ constant.language.nil.sema

(regex/match? #"\d+" "abc123")
;^^^^^^^^^^^^ support.function.sema
; ^^^^^^ string.regexp.sema

(regex/match? #"\"[^\"]+\"" text)
; ^^^^^^^^^^^^^ string.regexp.sema

(regex/match? #"\\" text)
; ^^^^^ string.regexp.sema
Loading