Skip to content

Commit f42cdb0

Browse files
committed
[#25] Add support for mod keyword
1 parent ca20051 commit f42cdb0

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

Syntax/Just.sublime-syntax

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ variables:
166166
contexts:
167167
main:
168168
- include: includes
169+
- include: modules
169170
- include: settings
170171
- include: aliases
171172
- include: comments
@@ -199,6 +200,18 @@ contexts:
199200
1: keyword.control.import.just
200201
2: meta.generic-name.just
201202

203+
modules:
204+
- match: ^(mod)(\??)(\s+\w+)
205+
scope: meta.statement.mod.just
206+
captures:
207+
1: keyword.control.import.just
208+
2: keyword.operator.assignment.just
209+
3: meta.generic-name.just
210+
- match: '`'
211+
scope: invalid.illegal.just
212+
pop: 2
213+
- include: quoted-strings
214+
202215
###[ ALIASES ]#################################################################
203216

204217
aliases:

Syntax/tests/syntax_test_just.include.just

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,20 @@
55
# <- keyword.control.import.just
66
#^^^^^^^ keyword.control.import.just
77
# ^^^^^^^^^^^^ meta.generic-name.just
8+
9+
10+
mod Something
11+
#^^^^^^^^^^^^ meta.statement.mod.just
12+
#^^ keyword.control.import.just
13+
# ^^^^^^^^^ meta.generic-name.just
14+
15+
mod? foo
16+
#^^^^^^^ meta.statement.mod.just
17+
# ^ keyword.operator.assignment.just
18+
19+
mod foo2 'somewhere/else' # comment
20+
# ^ string.quoted.single.just punctuation.definition.string.begin.just
21+
# ^^^^^^^^^^^^^^^ string.quoted.single.just
22+
23+
mod a `yes`
24+
# ^ invalid.illegal.just

0 commit comments

Comments
 (0)