| 1 | { |
| 2 | "fileTypes": ["Makefile", "makefile", "GNUmakefile", "OCamlMakefile"], |
| 3 | "name": "Makefile", |
| 4 | "patterns": [ |
| 5 | { |
| 6 | "include": "#comment" |
| 7 | }, |
| 8 | { |
| 9 | "include": "#variable-assignment" |
| 10 | }, |
| 11 | { |
| 12 | "include": "#recipe" |
| 13 | }, |
| 14 | { |
| 15 | "include": "#directives" |
| 16 | } |
| 17 | ], |
| 18 | "repository": { |
| 19 | "comment": { |
| 20 | "begin": "(^[ \\t]+)?(?=#)", |
| 21 | "beginCaptures": { |
| 22 | "1": { |
| 23 | "name": "punctuation.whitespace.comment.leading.makefile" |
| 24 | } |
| 25 | }, |
| 26 | "end": "(?!\\G)", |
| 27 | "patterns": [ |
| 28 | { |
| 29 | "begin": "#", |
| 30 | "beginCaptures": { |
| 31 | "0": { |
| 32 | "name": "punctuation.definition.comment.makefile" |
| 33 | } |
| 34 | }, |
| 35 | "end": "\\n", |
| 36 | "name": "comment.line.number-sign.makefile", |
| 37 | "patterns": [ |
| 38 | { |
| 39 | "match": "\\\\\\n", |
| 40 | "name": "constant.character.escape.continuation.makefile" |
| 41 | } |
| 42 | ] |
| 43 | } |
| 44 | ] |
| 45 | }, |
| 46 | "directives": { |
| 47 | "patterns": [ |
| 48 | { |
| 49 | "begin": "^[ ]*([s\\-]?include)\\b", |
| 50 | "beginCaptures": { |
| 51 | "1": { |
| 52 | "name": "keyword.control.include.makefile" |
| 53 | } |
| 54 | }, |
| 55 | "end": "^", |
| 56 | "patterns": [ |
| 57 | { |
| 58 | "include": "#comment" |
| 59 | }, |
| 60 | { |
| 61 | "include": "#variables" |
| 62 | }, |
| 63 | { |
| 64 | "match": "%", |
| 65 | "name": "constant.other.placeholder.makefile" |
| 66 | } |
| 67 | ] |
| 68 | }, |
| 69 | { |
| 70 | "begin": "^[ ]*(vpath)\\b", |
| 71 | "beginCaptures": { |
| 72 | "1": { |
| 73 | "name": "keyword.control.vpath.makefile" |
| 74 | } |
| 75 | }, |
| 76 | "end": "^", |
| 77 | "patterns": [ |
| 78 | { |
| 79 | "include": "#comment" |
| 80 | }, |
| 81 | { |
| 82 | "include": "#variables" |
| 83 | }, |
| 84 | { |
| 85 | "match": "%", |
| 86 | "name": "constant.other.placeholder.makefile" |
| 87 | } |
| 88 | ] |
| 89 | }, |
| 90 | { |
| 91 | "begin": "^(?:(override)\\s*)?(define)\\s*([^\\s]+)\\s*(=|\\?=|:=|\\+=)?(?=\\s)", |
| 92 | "captures": { |
| 93 | "1": { |
| 94 | "name": "keyword.control.override.makefile" |
| 95 | }, |
| 96 | "2": { |
| 97 | "name": "keyword.control.define.makefile" |
| 98 | }, |
| 99 | "3": { |
| 100 | "name": "variable.other.makefile" |
| 101 | }, |
| 102 | "4": { |
| 103 | "name": "punctuation.separator.key-value.makefile" |
| 104 | } |
| 105 | }, |
| 106 | "end": "^(endef)\\b", |
| 107 | "name": "meta.scope.conditional.makefile", |
| 108 | "patterns": [ |
| 109 | { |
| 110 | "begin": "\\G(?!\\n)", |
| 111 | "end": "^", |
| 112 | "patterns": [ |
| 113 | { |
| 114 | "include": "#comment" |
| 115 | } |
| 116 | ] |
| 117 | }, |
| 118 | { |
| 119 | "include": "#variables" |
| 120 | }, |
| 121 | { |
| 122 | "include": "#comment" |
| 123 | } |
| 124 | ] |
| 125 | }, |
| 126 | { |
| 127 | "begin": "^[ ]*(export)\\b", |
| 128 | "beginCaptures": { |
| 129 | "1": { |
| 130 | "name": "keyword.control.$1.makefile" |
| 131 | } |
| 132 | }, |
| 133 | "end": "^", |
| 134 | "patterns": [ |
| 135 | { |
| 136 | "include": "#comment" |
| 137 | }, |
| 138 | { |
| 139 | "include": "#variable-assignment" |
| 140 | }, |
| 141 | { |
| 142 | "match": "[^\\s]+", |
| 143 | "name": "variable.other.makefile" |
| 144 | } |
| 145 | ] |
| 146 | }, |
| 147 | { |
| 148 | "begin": "^[ ]*(override|private)\\b", |
| 149 | "beginCaptures": { |
| 150 | "1": { |
| 151 | "name": "keyword.control.$1.makefile" |
| 152 | } |
| 153 | }, |
| 154 | "end": "^", |
| 155 | "patterns": [ |
| 156 | { |
| 157 | "include": "#comment" |
| 158 | }, |
| 159 | { |
| 160 | "include": "#variable-assignment" |
| 161 | } |
| 162 | ] |
| 163 | }, |
| 164 | { |
| 165 | "begin": "^[ ]*(unexport|undefine)\\b", |
| 166 | "beginCaptures": { |
| 167 | "1": { |
| 168 | "name": "keyword.control.$1.makefile" |
| 169 | } |
| 170 | }, |
| 171 | "end": "^", |
| 172 | "patterns": [ |
| 173 | { |
| 174 | "include": "#comment" |
| 175 | }, |
| 176 | { |
| 177 | "match": "[^\\s]+", |
| 178 | "name": "variable.other.makefile" |
| 179 | } |
| 180 | ] |
| 181 | }, |
| 182 | { |
| 183 | "begin": "^(ifdef|ifndef)\\s*([^\\s]+)(?=\\s)", |
| 184 | "captures": { |
| 185 | "1": { |
| 186 | "name": "keyword.control.$1.makefile" |
| 187 | }, |
| 188 | "2": { |
| 189 | "name": "variable.other.makefile" |
| 190 | }, |
| 191 | "3": { |
| 192 | "name": "punctuation.separator.key-value.makefile" |
| 193 | } |
| 194 | }, |
| 195 | "end": "^(endif)\\b", |
| 196 | "name": "meta.scope.conditional.makefile", |
| 197 | "patterns": [ |
| 198 | { |
| 199 | "begin": "\\G(?!\\n)", |
| 200 | "end": "^", |
| 201 | "patterns": [ |
| 202 | { |
| 203 | "include": "#comment" |
| 204 | } |
| 205 | ] |
| 206 | }, |
| 207 | { |
| 208 | "include": "$self" |
| 209 | } |
| 210 | ] |
| 211 | }, |
| 212 | { |
| 213 | "begin": "^(ifeq|ifneq)(?=\\s)", |
| 214 | "captures": { |
| 215 | "1": { |
| 216 | "name": "keyword.control.$1.makefile" |
| 217 | } |
| 218 | }, |
| 219 | "end": "^(endif)\\b", |
| 220 | "name": "meta.scope.conditional.makefile", |
| 221 | "patterns": [ |
| 222 | { |
| 223 | "begin": "\\G", |
| 224 | "end": "^", |
| 225 | "name": "meta.scope.condition.makefile", |
| 226 | "patterns": [ |
| 227 | { |
| 228 | "include": "#variables" |
| 229 | }, |
| 230 | { |
| 231 | "include": "#comment" |
| 232 | } |
| 233 | ] |
| 234 | }, |
| 235 | { |
| 236 | "begin": "^else(?=\\s)", |
| 237 | "beginCaptures": { |
| 238 | "0": { |
| 239 | "name": "keyword.control.else.makefile" |
| 240 | } |
| 241 | }, |
| 242 | "end": "^" |
| 243 | }, |
| 244 | { |
| 245 | "include": "$self" |
| 246 | } |
| 247 | ] |
| 248 | } |
| 249 | ] |
| 250 | }, |
| 251 | "interpolation": { |
| 252 | "begin": "(?=`)", |
| 253 | "end": "(?!\\G)", |
| 254 | "name": "meta.embedded.line.shell", |
| 255 | "patterns": [ |
| 256 | { |
| 257 | "begin": "`", |
| 258 | "beginCaptures": { |
| 259 | "0": { |
| 260 | "name": "punctuation.definition.string.makefile" |
| 261 | } |
| 262 | }, |
| 263 | "contentName": "source.shell", |
| 264 | "end": "(`)", |
| 265 | "endCaptures": { |
| 266 | "0": { |
| 267 | "name": "punctuation.definition.string.makefile" |
| 268 | }, |
| 269 | "1": { |
| 270 | "name": "source.shell" |
| 271 | } |
| 272 | }, |
| 273 | "name": "string.interpolated.backtick.makefile", |
| 274 | "patterns": [ |
| 275 | { |
| 276 | "include": "source.shell" |
| 277 | } |
| 278 | ] |
| 279 | } |
| 280 | ] |
| 281 | }, |
| 282 | "recipe": { |
| 283 | "begin": "^(?!\\t)([^:]*)(:)(?!\\=)", |
| 284 | "beginCaptures": { |
| 285 | "1": { |
| 286 | "patterns": [ |
| 287 | { |
| 288 | "captures": { |
| 289 | "1": { |
| 290 | "name": "support.function.target.$1.makefile" |
| 291 | } |
| 292 | }, |
| 293 | "match": "^\\s*(\\.(PHONY|SUFFIXES|DEFAULT|PRECIOUS|INTERMEDIATE|SECONDARY|SECONDEXPANSION|DELETE_ON_ERROR|IGNORE|LOW_RESOLUTION_TIME|SILENT|EXPORT_ALL_VARIABLES|NOTPARALLEL|ONESHELL|POSIX))\\s*$" |
| 294 | }, |
| 295 | { |
| 296 | "begin": "(?=\\S)", |
| 297 | "end": "(?=\\s|$)", |
| 298 | "name": "entity.name.function.target.makefile", |
| 299 | "patterns": [ |
| 300 | { |
| 301 | "include": "#variables" |
| 302 | }, |
| 303 | { |
| 304 | "match": "%", |
| 305 | "name": "constant.other.placeholder.makefile" |
| 306 | } |
| 307 | ] |
| 308 | } |
| 309 | ] |
| 310 | }, |
| 311 | "2": { |
| 312 | "name": "punctuation.separator.key-value.makefile" |
| 313 | } |
| 314 | }, |
| 315 | "end": "^(?!\\t)", |
| 316 | "name": "meta.scope.target.makefile", |
| 317 | "patterns": [ |
| 318 | { |
| 319 | "begin": "\\G", |
| 320 | "end": "^", |
| 321 | "name": "meta.scope.prerequisites.makefile", |
| 322 | "patterns": [ |
| 323 | { |
| 324 | "match": "\\\\\\n", |
| 325 | "name": "constant.character.escape.continuation.makefile" |
| 326 | }, |
| 327 | { |
| 328 | "match": "%|\\*", |
| 329 | "name": "constant.other.placeholder.makefile" |
| 330 | }, |
| 331 | { |
| 332 | "include": "#comment" |
| 333 | }, |
| 334 | { |
| 335 | "include": "#variables" |
| 336 | } |
| 337 | ] |
| 338 | }, |
| 339 | { |
| 340 | "begin": "^\\t", |
| 341 | "name": "meta.scope.recipe.makefile", |
| 342 | "patterns": [ |
| 343 | { |
| 344 | "captures": { |
| 345 | "0": { |
| 346 | "patterns": [ |
| 347 | { |
| 348 | "match": "\\\\\\n", |
| 349 | "name": "constant.character.escape.continuation.makefile" |
| 350 | }, |
| 351 | { |
| 352 | "include": "#variables" |
| 353 | }, |
| 354 | { |
| 355 | "include": "source.shell" |
| 356 | } |
| 357 | ] |
| 358 | } |
| 359 | }, |
| 360 | "match": ".+\\n?" |
| 361 | } |
| 362 | ], |
| 363 | "while": "^\\t" |
| 364 | } |
| 365 | ] |
| 366 | }, |
| 367 | "variable-assignment": { |
| 368 | "begin": "(^[ ]*|\\G\\s*)([^\\s]+)\\s*(=|\\?=|:=|\\+=)", |
| 369 | "beginCaptures": { |
| 370 | "2": { |
| 371 | "name": "variable.other.makefile" |
| 372 | }, |
| 373 | "3": { |
| 374 | "name": "punctuation.separator.key-value.makefile" |
| 375 | } |
| 376 | }, |
| 377 | "end": "\\n", |
| 378 | "patterns": [ |
| 379 | { |
| 380 | "match": "\\\\\\n", |
| 381 | "name": "constant.character.escape.continuation.makefile" |
| 382 | }, |
| 383 | { |
| 384 | "include": "#comment" |
| 385 | }, |
| 386 | { |
| 387 | "include": "#variables" |
| 388 | }, |
| 389 | { |
| 390 | "include": "#interpolation" |
| 391 | } |
| 392 | ] |
| 393 | }, |
| 394 | "variables": { |
| 395 | "patterns": [ |
| 396 | { |
| 397 | "captures": { |
| 398 | "1": { |
| 399 | "name": "punctuation.definition.variable.makefile" |
| 400 | } |
| 401 | }, |
| 402 | "match": "(\\$?\\$)[@%<?^+*]", |
| 403 | "name": "variable.language.makefile" |
| 404 | }, |
| 405 | { |
| 406 | "begin": "\\$?\\$\\(", |
| 407 | "captures": { |
| 408 | "0": { |
| 409 | "name": "punctuation.definition.variable.makefile" |
| 410 | } |
| 411 | }, |
| 412 | "end": "\\)", |
| 413 | "name": "string.interpolated.makefile", |
| 414 | "patterns": [ |
| 415 | { |
| 416 | "include": "#variables" |
| 417 | }, |
| 418 | { |
| 419 | "match": "\\G(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))", |
| 420 | "name": "variable.language.makefile" |
| 421 | }, |
| 422 | { |
| 423 | "begin": "\\G(subst|patsubst|strip|findstring|filter(-out)?|sort|word(list)?|firstword|lastword|dir|notdir|suffix|basename|addsuffix|addprefix|join|wildcard|realpath|abspath|info|error|warning|shell|foreach|if|or|and|call|eval|value|file|guile)\\s", |
| 424 | "beginCaptures": { |
| 425 | "1": { |
| 426 | "name": "support.function.$1.makefile" |
| 427 | } |
| 428 | }, |
| 429 | "end": "(?=\\))", |
| 430 | "name": "meta.scope.function-call.makefile", |
| 431 | "patterns": [ |
| 432 | { |
| 433 | "include": "#variables" |
| 434 | }, |
| 435 | { |
| 436 | "match": "%|\\*", |
| 437 | "name": "constant.other.placeholder.makefile" |
| 438 | } |
| 439 | ] |
| 440 | }, |
| 441 | { |
| 442 | "begin": "\\G(origin|flavor)\\s(?=[^\\s)]+\\s*\\))", |
| 443 | "contentName": "variable.other.makefile", |
| 444 | "end": "(?=\\))", |
| 445 | "name": "meta.scope.function-call.makefile", |
| 446 | "patterns": [ |
| 447 | { |
| 448 | "include": "#variables" |
| 449 | } |
| 450 | ] |
| 451 | }, |
| 452 | { |
| 453 | "begin": "\\G(?!\\))", |
| 454 | "end": "(?=\\))", |
| 455 | "name": "variable.other.makefile", |
| 456 | "patterns": [ |
| 457 | { |
| 458 | "include": "#variables" |
| 459 | } |
| 460 | ] |
| 461 | } |
| 462 | ] |
| 463 | } |
| 464 | ] |
| 465 | } |
| 466 | }, |
| 467 | "scopeName": "source.makefile", |
| 468 | "uuid": "FF1825E8-6B1C-11D9-B883-000D93589AF6", |
| 469 | "version": "https://github.com/textmate/make.tmbundle/commit/1a1827da81e20fdce56e2658451340c070ca44b7" |
| 470 | } |