@@ -0,0 +1,52 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: Ninja
5+file_extensions:
6+ - ninja
7+scope: source.ninja
8+contexts:
9+ main:
10+ - match: (#).*$\n?
11+ comment: Comment line.
12+ scope: comment.line.number-sign.ninja
13+ captures:
14+ 1: punctuation.definition.comment.ninja
15+ - match: ^(rule)\b
16+ comment: Rule keyword and keywords for a rule.
17+ captures:
18+ 1: keyword.other.ninja
19+ push:
20+ - match: ^(?=\S)
21+ pop: true
22+ - include: main
23+ - match: \b(?:command|deps|depfile|description|generator|pool|restat|rspfile|rspfile_content)\b
24+ scope: keyword.other.ninja
25+ - match: ^(pool)\b
26+ comment: Pool keyword and keywords for a pool.
27+ captures:
28+ 1: keyword.other.ninja
29+ push:
30+ - match: ^(?=\S)
31+ pop: true
32+ - include: main
33+ - match: \b(?:depth)\b
34+ scope: keyword.other.ninja
35+ - match: ^(?:build|rule|default|include|subninja)\b
36+ comment: Other Keywords.
37+ scope: keyword.other.ninja
38+ - match: '(?:[=:]|\|{1,2})(?=\s)'
39+ comment: Operators for variable assignment (=), rule definition (:), implicit (|) and order only (||) dependencies.
40+ scope: keyword.operator.ninja
41+ - match: \$$
42+ comment: Line wrap.
43+ scope: keyword.operator.ninja
44+ - match: \$\$
45+ comment: Dollar literal.
46+ scope: keyword.operator.ninja
47+ - match: '\$[[:alnum:]_-]+'
48+ comment: Simple variables, e.g. $var.
49+ scope: variable.other.ninja
50+ - match: '\${[[:alnum:]_.-]+}'
51+ comment: "Variables, e.g. ${some.var.name}."
52+ scope: variable.other.ninja