-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathninja.sublime-syntax
64 lines (59 loc) · 1.58 KB
/
ninja.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
62
63
64
%YAML 1.2
---
name: Ninja
file_extensions: [ninja]
scope: source.ninja
contexts:
prototype:
- match: \#.+
scope: comment.line.source.ninja
- match: \$[a-zA-Z0-9_-]+
scope: support.other.variable.ninja
- match: \$$
scope: keyword.ninja
push: lineskip
main:
- match: ^\s*(ninja_required_version|ninja_dyndep_version|builddir|default|subninja|include)\b\s
scope: keyword.ninja
- match: ^(rule)\s+([a-zA-Z0-9.\-_@/\\$|]+)
push: rule
captures:
1: keyword.ninja
2: constant.language.ninja
- match: '^(build)\s+([a-zA-Z0-9.\-_@/\\\s$|]+):\s+(?:(phony)|(dyndep)|([a-zA-Z0-9][a-zA-Z0-9_-]*))'
push: build
captures:
1: keyword.ninja
2: entity.name.function.ninja
3: keyword.ninja
4: keyword.ninja
5: constant.language.ninja
- match: ^([a-zA-Z0-9-_]+)\s+=
captures:
1: support.other.variable.ninja
- match: \b\d+(?:\.\d+(?:\.\d+)?)?\b
scope: constant.numeric.ninja
rule:
- match: '^\s*$'
pop: true
- match: ^\w
pop: true
- match: \s+(command|depfile|deps|msvc_deps_prefix|description|generator|restat|rspfile|rspfile_context|pool|dyndep)\s+=
captures:
1: keyword.ninja
- match: \$(in|out)
scope: constant.language.ninja
build:
- match: '^\s*$'
pop: true
- match: ^\w
pop: true
- match: \s+(pool)\s+=
captures:
1: keyword.ninja
- match: \s+([a-zA-Z0-9-_]+)\s+=
captures:
1: support.other.variable.ninja
lineskip:
- match: ^
pop: true