-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile2.YAML-tmLanguage
136 lines (123 loc) · 3.54 KB
/
Makefile2.YAML-tmLanguage
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# [PackageDev] target_format: plist, ext: tmLanguage
---
uuid: FF1825E8-6B1C-11D9-B883-000D93589AF6
name: Makefile
scopeName: source.makefile2
fileTypes:
- make
- GNUmakefile
- makefile
- Makefile
- OCamlMakefile
- mak
- mk
repository:
escaped-char:
name: constant.character.escape.makefile
match: \\.
patterns: []
variable-reference:
begin: \$\(
end: \)
name: string.interpolated.makefile
contentName: variable.other.makefile
patterns:
- include: $self
- name: string.other.substitution.makefile
match: (:)[a-zA-Z0-9_%.]+(=)[a-zA-Z0-9_%.]+
captures:
'1': {name: keyword.operator.substitution.makefile}
'2': {name: keyword.operator.substitution.makefile}
- name: meta.scope.function.makefile
begin: "(?<=\\$\\()(addprefix|addsuffix|and|basename|call|dir|error|\
eval|file|filter(-out)?|findstring|firstword|flavor|foreach|guile|\
if|info|join|notdir|or|origin|patsubst|shell|sort|strip|subst|suffix|\
value|warning|wildcard|words?)\\b"
end: (?=\))
beginCaptures:
'1': {name: support.function.makefile}
contentName: string.interpolated.makefile
patterns:
- include: $self
automatic-variable:
name: variable.language.makefile
match: \$([@%<?^+*]|\([@*%<^?][DF]\))
patterns: []
shell-variable-reference:
begin: \$\{
end: \}
contentName: variable.other.shell.makefile
patterns: []
simple-variable:
name: variable.other.shell.makefile
match: \$\$?\w+
patterns: []
variables:
patterns:
- include: '#shell-variable-variable'
- include: '#variable-reference'
- include: '#simple-variable'
double-quoted-string:
name: string.quoted.double.makefile
begin: '"'
end: '"'
patterns:
- include: '#escaped-char'
single-quoted-string:
name: string.quoted.single.makefile
begin: ''''
end: ''''
patterns:
- include: '#escaped-char'
backtick-subshell:
name: string.interpolated.backtick.makefile
begin: '`'
end: '`'
patterns:
- include: source.shell
- include: '#variables'
comment:
name: comment.line.number-sign.makefile
begin: '#'
end: $\n?
beginCaptures:
'0': {name: punctuation.definition.comment.makefile}
patterns:
- name: punctuation.separator.continuation.makefile
match: (?<!\\)\\$\n
assignment:
name: meta.assignment.makefile
begin: ^([a-zA-Z_][a-zA-Z0-9_]*)\s*([\+\?:]?=)
beginCaptures:
'1': {name: variable.other.makefile}
'2': {name: keyword.operator.assignment.makefile}
end: (?<!\\)\n$
patterns:
- include: '#automatic-variable'
- include: '#variables'
- include: '#escaped-char'
- include: '#double-quoted-string'
- include: '#single-quoted-string'
- include: '#backtick-subshell'
rule:
name: meta.rule.makefile
begin: '^([^\t\:][^\:]*)\:'
end: "^(?!\t)"
beginCaptures:
'1': {name: entity.name.function.rule.makefile}
patterns:
- name: meta.prerequisites.makefile
begin: (?<=:)(?=.)
end: ;|\n
patterns:
- include: '#variable-reference'
- include: '#automatic-variable'
- include: '#variable-reference'
- include: source.shell
patterns:
- include: '#comment'
- include: '#assignment'
- include: '#rule'
- name: keyword.control.makefile
match: ^(\-??include|if|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)\b
- include: '#variables'