-
Notifications
You must be signed in to change notification settings - Fork 16
/
Automake.YAML-tmLanguage
226 lines (214 loc) · 7.57 KB
/
Automake.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# [PackageDev] target_format: plist, ext: tmLanguage
---
uuid: db931ddb-e919-4736-bd7d-fcf6e1ceca7f
name: Automake
scopeName: source.automake
fileTypes:
- am
- am.inc
- Makefile.in
repository:
# Contexts copied from Makefile syntax definition
# -----------------------------------------------
escaped-char:
name: constant.character.escape.makefile
match: \\.
patterns: []
variable-reference:
contentName: variable.other.makefile
begin: \$\(
end: \)
name: string.interpolated.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:
contentName: variable.other.shell.makefile
begin: \$\{
end: \}
patterns: []
simple-variable:
name: variable.other.shell.makefile
match: \$\$?\w+
patterns: []
variables:
patterns:
- include: '#shell-variable-reference'
- 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'
# Automake-specific syntax
# ------------------------
substitution:
# Substitutions from AC_SUBST
name: string.interpolated.substitution.automake
match: '@\w+@'
patterns: []
no-subst-comment:
# Lines starting with ## are not copied into Makefile.in, and no
# substitutions are performed
name: comment.line.double-number-sign.automake
begin: ^##
end: $
patterns: []
comment:
# Copy of Makefile's comment, but substitutions are allowed
name: comment.line.number-sign.automake
begin: '#'
end: $
patterns:
- include: '#substitution'
escaped-newline:
name: constant.character.escape.automake
match: \\$
patterns: []
flags-assignment:
# Assignment to a FLAGS variable
name: meta.assignment.flags.automake
begin: "^ *((?:AM_)?(?:C|CCAS|CPP|CXX|F|GCJ|JAVAC|L|LD|LIBTOOL|\
(?:[A-Z]+_)?LOG|MAKEINFO(?:HTML)?|OBJC|R|UPC|VALA|Y)FLAGS)\
\\s*([\\+\\?:]?=)"
end: (?<!\\)\n$
beginCaptures:
'1': {name: keyword.other.flags.automake}
'2': {name: keyword.operator.assignment.automake}
patterns:
- include: '#assignment-rhs'
keyword-assignment:
# Assignment to a non-primary, secondary, flags, or dir variable
name: meta.assignment.keyword.automake
begin: "^ *(AM_(?:DEFAULT_SOURCE_EXT|DISTCHECK_CONFIGURE_FLAGS|\
TESTS_(?:ENVIRONMENT|FD_REDIRECT))|AUTOMAKE_OPTIONS|BUILT_SOURCES|CC|\
CLASSPATH_ENV|(?:DIST|MAINTAINER|MOSTLY)?CLEANFILES|COMPILE|\
(?:CXX|FC|OBJC|UPC)(?:COMPILE|LINK)?|DEFAULT_INCLUDES|DEFS|DVIPS|\
ETAGS_ARGS|EXTRA_DIST|F77(?:COMPILE)?|FLINK|INCLUDE|JAVAC|JAVAROOT|LIBS|\
LINK|(?:[A-Z]+_)?LOG_COMPILER|MAKEINFO(?:HTML)?|\
(?:OMIT|TAGS)_DEPENDENCIES|(?:DIST_)?SUBDIRS|SUFFIXES|\
TESTS(?:_ENVIRONMENT)?|TEXI2(?:DVI|PDF)|TEXINFO_TEX|VALAC)\
\\s*([\\+\\?:]?=)"
end: (?<!\\)\n$
beginCaptures:
'1': {name: keyword.other.automake}
'2': {name: keyword.operator.assignment.automake}
patterns:
- include: '#assignment-rhs'
primary-assignment:
# Assignment to a primary: any number of prefixes_, then either a nondir
# target (e.g. noinst), a dir target (e.g. bin), or a user-defined dir, then
# finally a _PRIMARY
name: meta.assignment.primary.automake
begin: "^ *(?:((?:(?:(?:no)?dist|no(?:base|trans))_)*)\
(?:(noinst|check|EXTRA)|(s?bin|(?:pkg)?lib(?:exec)?|(?:pkg)?data|\
(?:pkg|old)?include|dataroot|sysconf|(?:shared|local)state|doc|info|html|\
dvi|pdf|ps|lisp|locale|man[1-8]?(?:ext)?|src|(?:pkg)?python|\
(?:pkg)?pyexec)|([\\w@]+))(_(?:PROGRAMS|(?:LT)?LIBRARIES|LISP|PYTHON|\
JAVA|SCRIPTS|DATA|HEADERS|MANS|TEXINFOS)))\\s*([\\+\\?:]?=)"
end: (?<!\\)\n$
beginCaptures:
'1': {name: keyword.other.prefix.automake}
'2': {name: keyword.other.nondir-target.automake}
'3': {name: keyword.other.dir-target.automake}
'4': {name: variable.other.dir-target.automake}
'5': {name: storage.type.primary.automake}
'6': {name: keyword.operator.assignment.automake}
patterns:
- include: '#assignment-rhs'
secondary-assignment:
# Assignment to a secondary: any number of prefix_ or EXTRA_, then the
# canonicalized_program_name, and finally a _SECONDARY
name: meta.assignment.secondary.automake
begin: "^ *((?:(?:(?:no)?dist|no(?:base|trans)|EXTRA)_)*)([\\w@]+)\
(_(?:AR|DEPENDENCIES|LDADD|LIBADD|LINK|SHORTNAME|SOURCES|(?:C|CCAS|CPP|\
CXX|F|GCJ|JAVAC|L|LD|LIBTOOL|(?:[A-Z]+_)?LOG|MAKEINFO(?:HTML)?|OBJC|R|\
UPC|VALA|Y)FLAGS))\\s*([\\+\\?:]?=)"
end: (?<!\\)\n$
beginCaptures:
'1': {name: keyword.other.prefix.automake}
'2': {name: variable.other.canonicalized-program-name.automake}
'3': {name: keyword.other.secondary.automake}
'4': {name: keyword.operator.assignment.automake}
patterns:
- include: '#assignment-rhs'
dir-assignment:
# Assignment to a directory variable (e.g. foobardir)
name: meta.assignment.directory.automake
begin: ^ *([\w@]+)(dir)\s*([\+\?:]?=)
end: (?<!\\)\n$
beginCaptures:
'1': {name: variable.other.directory.automake}
'2': {name: keyword.other.automake}
'3': {name: keyword.operator.assignment.automake}
patterns:
- include: '#assignment-rhs'
special-assignment:
# The contexts listed here represent an assignment to an Automake variable
patterns:
- include: '#flags-assignment'
- include: '#keyword-assignment'
- include: '#primary-assignment'
- include: '#secondary-assignment'
- include: '#dir-assignment'
assignment-rhs:
# What is allowed on the right-hand-side of an assignment
patterns:
- include: '#automatic-variable'
- include: '#variables'
- include: '#escaped-char'
- include: '#double-quoted-string'
- include: '#single-quoted-string'
- include: '#backtick-subshell'
- include: '#substitution'
- include: '#escaped-newline'
- include: '#comment'
patterns:
- include: '#no-subst-comment'
- include: '#comment'
- include: '#special-assignment'
- name: meta.assignment.automake
begin: ^([a-zA-Z_@][\w@]*)\s*([\+\?:]?=)
end: (?<!\\)\n$
beginCaptures:
'1': {name: variable.other.automake}
'2': {name: keyword.operator.assignment.automake}
patterns:
- include: '#assignment-rhs'
- include: '#comment'
- include: source.makefile2
- include: '#substitution'