forked from casey/just
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjust.sublime-syntax
61 lines (61 loc) · 1.55 KB
/
just.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
%YAML 1.2
---
# http://www.sublimetext.com/docs/syntax.html
name: Just
file_extensions: [.justfile, just, justfile]
scope: source.just
contexts:
main:
- include: interpolate
- include: comments
- include: scripts
- include: strings
- include: assignments
- include: recipeDefinition
- include: keywords
assignments:
- match: '^(export[\s]?)?([a-zA-Z_][a-zA-Z0-9_-]*)='
captures:
1: storage.type.just
2: variable.name.just
comments:
- match: '^#[^!].*'
scope: comment.line.just
interpolate:
- match: '\{\{'
push:
- meta_scope: string.interpolated.just
- match: '\}\}'
pop: true
keywords:
- match: \b(arch|os|os_family|env_var|env_var_or_default)\b
scope: keyword.control.just
recipeDefinition:
- match: '^(@)?([a-zA-Z_][a-zA-Z0-9_-]*)([a-zA-Z0-9=\s_-`''"]*):([\sa-zA-Z0-9_-]*).*$'
captures:
1: entity.name.function.just
2: entity.name.function.just
4: support.type.property-name.just
scripts:
- match: \s#\!
comment: The #! lines within a recipe.
push:
- meta_scope: support.type.property-name.just
- match: $
pop: true
strings:
- match: '`'
push:
- meta_scope: string.quoted.triple.just
- match: '`'
pop: true
- match: '"'
push:
- meta_scope: string.quoted.double.just
- match: '"'
pop: true
- match: "'"
push:
- meta_scope: string.quoted.single.just
- match: "'"
pop: true