Path: blob/main/extensions/make/syntaxes/make.tmLanguage.json
3292 views
{1"information_for_contributors": [2"This file has been converted from https://github.com/fadeevab/make.tmbundle/blob/master/Syntaxes/Makefile.plist",3"If you want to provide a fix or improvement, please create a pull request against the original repository.",4"Once accepted there, we are happy to receive an update request."5],6"version": "https://github.com/fadeevab/make.tmbundle/commit/1d4c0b541959995db098df751ffc129da39a294b",7"name": "Makefile",8"scopeName": "source.makefile",9"patterns": [10{11"include": "#comment"12},13{14"include": "#variables"15},16{17"include": "#variable-assignment"18},19{20"include": "#directives"21},22{23"include": "#recipe"24},25{26"include": "#target"27}28],29"repository": {30"comma": {31"match": ",",32"name": "punctuation.separator.delimeter.comma.makefile"33},34"comment": {35"begin": "(^[ ]+)?((?<!\\\\)(\\\\\\\\)*)(?=#)",36"beginCaptures": {37"1": {38"name": "punctuation.whitespace.comment.leading.makefile"39}40},41"end": "(?!\\G)",42"patterns": [43{44"begin": "#",45"beginCaptures": {46"0": {47"name": "punctuation.definition.comment.makefile"48}49},50"end": "(?=[^\\\\])$",51"name": "comment.line.number-sign.makefile",52"patterns": [53{54"match": "\\\\\\n",55"name": "constant.character.escape.continuation.makefile"56}57]58}59]60},61"directives": {62"patterns": [63{64"begin": "^[ ]*([s\\-]?include)\\b",65"beginCaptures": {66"1": {67"name": "keyword.control.include.makefile"68}69},70"end": "^",71"patterns": [72{73"include": "#comment"74},75{76"include": "#variables"77},78{79"match": "%",80"name": "constant.other.placeholder.makefile"81}82]83},84{85"begin": "^[ ]*(vpath)\\b",86"beginCaptures": {87"1": {88"name": "keyword.control.vpath.makefile"89}90},91"end": "^",92"patterns": [93{94"include": "#comment"95},96{97"include": "#variables"98},99{100"match": "%",101"name": "constant.other.placeholder.makefile"102}103]104},105{106"begin": "^\\s*(?:(override)\\s*)?(define)\\s*([^\\s]+)\\s*(=|\\?=|:=|\\+=)?(?=\\s)",107"captures": {108"1": {109"name": "keyword.control.override.makefile"110},111"2": {112"name": "keyword.control.define.makefile"113},114"3": {115"name": "variable.other.makefile"116},117"4": {118"name": "punctuation.separator.key-value.makefile"119}120},121"end": "^\\s*(endef)\\b",122"name": "meta.scope.conditional.makefile",123"patterns": [124{125"begin": "\\G(?!\\n)",126"end": "^",127"patterns": [128{129"include": "#comment"130}131]132},133{134"include": "#variables"135},136{137"include": "#directives"138}139]140},141{142"begin": "^[ ]*(export)\\b",143"beginCaptures": {144"1": {145"name": "keyword.control.$1.makefile"146}147},148"end": "^",149"patterns": [150{151"include": "#comment"152},153{154"include": "#variable-assignment"155},156{157"match": "[^\\s]+",158"name": "variable.other.makefile"159}160]161},162{163"begin": "^[ ]*(override|private)\\b",164"beginCaptures": {165"1": {166"name": "keyword.control.$1.makefile"167}168},169"end": "^",170"patterns": [171{172"include": "#comment"173},174{175"include": "#variable-assignment"176}177]178},179{180"begin": "^[ ]*(unexport|undefine)\\b",181"beginCaptures": {182"1": {183"name": "keyword.control.$1.makefile"184}185},186"end": "^",187"patterns": [188{189"include": "#comment"190},191{192"match": "[^\\s]+",193"name": "variable.other.makefile"194}195]196},197{198"begin": "^\\s*(ifeq|ifneq|ifdef|ifndef)(?=\\s)",199"captures": {200"1": {201"name": "keyword.control.$1.makefile"202}203},204"end": "^\\s*(endif)\\b",205"name": "meta.scope.conditional.makefile",206"patterns": [207{208"begin": "\\G",209"end": "^",210"name": "meta.scope.condition.makefile",211"patterns": [212{213"include": "#comma"214},215{216"include": "#variables"217},218{219"include": "#comment"220}221]222},223{224"begin": "^\\s*else(?=\\s)\\s*(ifeq|ifneq|ifdef|ifndef)*(?=\\s)",225"beginCaptures": {226"0": {227"name": "keyword.control.else.makefile"228}229},230"end": "^",231"patterns": [232{233"include": "#comma"234},235{236"include": "#variables"237},238{239"include": "#comment"240}241]242},243{244"include": "$self"245}246]247}248]249},250"target": {251"begin": "^(?!\\t)([^:]*)(:)(?!\\=)",252"beginCaptures": {253"1": {254"patterns": [255{256"captures": {257"1": {258"name": "support.function.target.$1.makefile"259}260},261"match": "^\\s*(\\.(PHONY|SUFFIXES|DEFAULT|PRECIOUS|INTERMEDIATE|SECONDARY|SECONDEXPANSION|DELETE_ON_ERROR|IGNORE|LOW_RESOLUTION_TIME|SILENT|EXPORT_ALL_VARIABLES|NOTPARALLEL|ONESHELL|POSIX))\\s*$"262},263{264"begin": "(?=\\S)",265"end": "(?=\\s|$)",266"name": "entity.name.function.target.makefile",267"patterns": [268{269"include": "#variables"270},271{272"match": "%",273"name": "constant.other.placeholder.makefile"274}275]276}277]278},279"2": {280"name": "punctuation.separator.key-value.makefile"281}282},283"end": "[^\\\\]$",284"name": "meta.scope.target.makefile",285"patterns": [286{287"begin": "\\G",288"end": "(?=[^\\\\])$",289"name": "meta.scope.prerequisites.makefile",290"patterns": [291{292"match": "\\\\\\n",293"name": "constant.character.escape.continuation.makefile"294},295{296"match": "%|\\*",297"name": "constant.other.placeholder.makefile"298},299{300"include": "#comment"301},302{303"include": "#variables"304}305]306}307]308},309"recipe": {310"begin": "^\\t([+\\-@]*)",311"beginCaptures": {312"1": {313"name": "keyword.control.$1.makefile"314}315},316"end": "[^\\\\]$",317"name": "meta.scope.recipe.makefile",318"patterns": [319{320"match": "\\\\\\n",321"name": "constant.character.escape.continuation.makefile"322},323{324"include": "#variables"325}326]327},328"variable-assignment": {329"begin": "(^[ ]*|\\G\\s*)([^\\s:#=]+)\\s*((?<![?:+!])=|\\?=|:=|\\+=|!=)",330"beginCaptures": {331"2": {332"name": "variable.other.makefile",333"patterns": [334{335"include": "#variables"336}337]338},339"3": {340"name": "punctuation.separator.key-value.makefile"341}342},343"end": "\\n",344"patterns": [345{346"match": "\\\\\\n",347"name": "constant.character.escape.continuation.makefile"348},349{350"include": "#comment"351},352{353"include": "#variables"354}355]356},357"interpolation": {358"patterns": [359{360"include": "#parentheses-interpolation"361},362{363"include": "#braces-interpolation"364}365]366},367"parentheses-interpolation": {368"begin": "\\(",369"end": "\\)",370"patterns": [371{372"include": "#variables"373},374{375"include": "#interpolation"376}377]378},379"braces-interpolation": {380"begin": "{",381"end": "}",382"patterns": [383{384"include": "#variables"385},386{387"include": "#interpolation"388}389]390},391"variables": {392"patterns": [393{394"include": "#simple-variable"395},396{397"include": "#variable-parentheses"398},399{400"include": "#variable-braces"401}402]403},404"simple-variable": {405"patterns": [406{407"match": "\\$[^(){}]",408"name": "variable.language.makefile"409}410]411},412"variable-parentheses": {413"patterns": [414{415"begin": "\\$\\(",416"captures": {417"0": {418"name": "punctuation.definition.variable.makefile"419}420},421"end": "\\)|((?<!\\\\)\\n)",422"name": "string.interpolated.makefile",423"patterns": [424{425"include": "#variables"426},427{428"include": "#builtin-variable-parentheses"429},430{431"include": "#function-variable-parentheses"432},433{434"include": "#flavor-variable-parentheses"435},436{437"include": "#another-variable-parentheses"438}439]440}441]442},443"variable-braces": {444"patterns": [445{446"begin": "\\${",447"captures": {448"0": {449"name": "punctuation.definition.variable.makefile"450}451},452"end": "}|((?<!\\\\)\\n)",453"name": "string.interpolated.makefile",454"patterns": [455{456"include": "#variables"457},458{459"include": "#builtin-variable-braces"460},461{462"include": "#function-variable-braces"463},464{465"include": "#flavor-variable-braces"466},467{468"include": "#another-variable-braces"469}470]471}472]473},474"builtin-variable-parentheses": {475"patterns": [476{477"match": "(?<=\\()(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))",478"name": "variable.language.makefile"479}480]481},482"builtin-variable-braces": {483"patterns": [484{485"match": "(?<={)(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*})",486"name": "variable.language.makefile"487}488]489},490"function-variable-parentheses": {491"patterns": [492{493"begin": "(?<=\\()(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",494"beginCaptures": {495"1": {496"name": "support.function.$1.makefile"497}498},499"end": "(?=\\)|((?<!\\\\)\\n))",500"name": "meta.scope.function-call.makefile",501"patterns": [502{503"include": "#comma"504},505{506"include": "#variables"507},508{509"include": "#interpolation"510},511{512"match": "%|\\*",513"name": "constant.other.placeholder.makefile"514},515{516"match": "\\\\\\n",517"name": "constant.character.escape.continuation.makefile"518}519]520}521]522},523"function-variable-braces": {524"patterns": [525{526"begin": "(?<={)(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",527"beginCaptures": {528"1": {529"name": "support.function.$1.makefile"530}531},532"end": "(?=}|((?<!\\\\)\\n))",533"name": "meta.scope.function-call.makefile",534"patterns": [535{536"include": "#comma"537},538{539"include": "#variables"540},541{542"include": "#interpolation"543},544{545"match": "%|\\*",546"name": "constant.other.placeholder.makefile"547},548{549"match": "\\\\\\n",550"name": "constant.character.escape.continuation.makefile"551}552]553}554]555},556"flavor-variable-parentheses": {557"patterns": [558{559"begin": "(?<=\\()(origin|flavor)\\s(?=[^\\s)]+\\s*\\))",560"contentName": "variable.other.makefile",561"beginCaptures": {562"1": {563"name": "support.function.$1.makefile"564}565},566"end": "(?=\\))",567"name": "meta.scope.function-call.makefile",568"patterns": [569{570"include": "#variables"571}572]573}574]575},576"flavor-variable-braces": {577"patterns": [578{579"begin": "(?<={)(origin|flavor)\\s(?=[^\\s}]+\\s*})",580"contentName": "variable.other.makefile",581"beginCaptures": {582"1": {583"name": "support.function.$1.makefile"584}585},586"end": "(?=})",587"name": "meta.scope.function-call.makefile",588"patterns": [589{590"include": "#variables"591}592]593}594]595},596"another-variable-parentheses": {597"patterns": [598{599"begin": "(?<=\\()(?!\\))",600"end": "(?=\\)|((?<!\\\\)\\n))",601"name": "variable.other.makefile",602"patterns": [603{604"include": "#variables"605},606{607"match": "\\\\\\n",608"name": "constant.character.escape.continuation.makefile"609}610]611}612]613},614"another-variable-braces": {615"patterns": [616{617"begin": "(?<={)(?!})",618"end": "(?=}|((?<!\\\\)\\n))",619"name": "variable.other.makefile",620"patterns": [621{622"include": "#variables"623},624{625"match": "\\\\\\n",626"name": "constant.character.escape.continuation.makefile"627}628]629}630]631}632}633}634635