[make] update grammar (fixes #55256)

This commit is contained in:
Martin Aeschlimann 2018-08-06 11:06:05 +02:00
parent 4911d7a784
commit e482fad1f0
2 changed files with 351 additions and 144 deletions

View file

@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/fadeevab/make.tmbundle/commit/43e1a67476dea3ddefbb4f0ee7901834b31b8bee",
"version": "https://github.com/fadeevab/make.tmbundle/commit/d94d403d6d31623763a4ff86b656886fa699ef60",
"name": "Makefile",
"scopeName": "source.makefile",
"patterns": [
@ -257,7 +257,7 @@
}
]
},
"interpolation": {
"shell-interpolation": {
"begin": "(?=`)",
"end": "(?!\\G)",
"name": "meta.embedded.line.shell",
@ -288,18 +288,6 @@
}
]
},
"braces-interpolation": {
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#variables"
},
{
"include": "#braces-interpolation"
}
]
},
"recipe": {
"begin": "^(?!\\t)([^:]*)(:)(?!\\=)",
"beginCaptures": {
@ -404,6 +392,40 @@
{
"include": "#comment"
},
{
"include": "#variables"
},
{
"include": "#shell-interpolation"
}
]
},
"interpolation": {
"patterns": [
{
"include": "#parentheses-interpolation"
},
{
"include": "#braces-interpolation"
}
]
},
"parentheses-interpolation": {
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#variables"
},
{
"include": "#interpolation"
}
]
},
"braces-interpolation": {
"begin": "{",
"end": "}",
"patterns": [
{
"include": "#variables"
},
@ -415,11 +437,28 @@
"variables": {
"patterns": [
{
"match": "\\$[^\\(\\)]",
"name": "variable.language.makefile"
"include": "#simple-variable"
},
{
"begin": "(\\$|(?<=\\$))\\(",
"include": "#variable-parentheses"
},
{
"include": "#variable-braces"
}
]
},
"simple-variable": {
"patterns": [
{
"match": "\\$[^(){}]",
"name": "variable.language.makefile"
}
]
},
"variable-parentheses": {
"patterns": [
{
"begin": "\\$\\(",
"captures": {
"0": {
"name": "punctuation.definition.variable.makefile"
@ -432,64 +471,199 @@
"include": "#variables"
},
{
"match": "(?<=\\()(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))",
"name": "variable.language.makefile"
"include": "#builtin-variable-parentheses"
},
{
"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",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=\\)|((?<!\\\\)\\n))",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
},
{
"include": "#braces-interpolation"
},
{
"match": "%|\\*",
"name": "constant.other.placeholder.makefile"
},
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
"include": "#function-variable-parentheses"
},
{
"begin": "(?<=\\()(origin|flavor)\\s(?=[^\\s)]+\\s*\\))",
"contentName": "variable.other.makefile",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=\\))",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
}
]
"include": "#flavor-variable-parentheses"
},
{
"begin": "(?<=\\()(?!\\))",
"end": "(?=\\)|((?<!\\\\)\\n))",
"name": "variable.other.makefile",
"patterns": [
{
"include": "#variables"
},
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
"include": "#another-variable-parentheses"
}
]
}
]
},
"variable-braces": {
"patterns": [
{
"begin": "\\${",
"captures": {
"0": {
"name": "punctuation.definition.variable.makefile"
}
},
"end": "}|((?<!\\\\)\\n)",
"name": "string.interpolated.makefile",
"patterns": [
{
"include": "#variables"
},
{
"include": "#builtin-variable-braces"
},
{
"include": "#function-variable-braces"
},
{
"include": "#flavor-variable-braces"
},
{
"include": "#another-variable-braces"
}
]
}
]
},
"builtin-variable-parentheses": {
"patterns": [
{
"match": "(?<=\\()(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))",
"name": "variable.language.makefile"
}
]
},
"builtin-variable-braces": {
"patterns": [
{
"match": "(?<={)(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*})",
"name": "variable.language.makefile"
}
]
},
"function-variable-parentheses": {
"patterns": [
{
"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",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=\\)|((?<!\\\\)\\n))",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
},
{
"include": "#interpolation"
},
{
"match": "%|\\*",
"name": "constant.other.placeholder.makefile"
},
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
}
]
},
"function-variable-braces": {
"patterns": [
{
"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",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=}|((?<!\\\\)\\n))",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
},
{
"include": "#interpolation"
},
{
"match": "%|\\*",
"name": "constant.other.placeholder.makefile"
},
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
}
]
},
"flavor-variable-parentheses": {
"patterns": [
{
"begin": "(?<=\\()(origin|flavor)\\s(?=[^\\s)]+\\s*\\))",
"contentName": "variable.other.makefile",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=\\))",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
}
]
}
]
},
"flavor-variable-braces": {
"patterns": [
{
"begin": "(?<={)(origin|flavor)\\s(?=[^\\s}]+\\s*})",
"contentName": "variable.other.makefile",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=})",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
}
]
}
]
},
"another-variable-parentheses": {
"patterns": [
{
"begin": "(?<=\\()(?!\\))",
"end": "(?=\\)|((?<!\\\\)\\n))",
"name": "variable.other.makefile",
"patterns": [
{
"include": "#variables"
},
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
}
]
},
"another-variable-braces": {
"patterns": [
{
"begin": "(?<={)(?!})",
"end": "(?=}|((?<!\\\\)\\n))",
"name": "variable.other.makefile",
"patterns": [
{
"include": "#variables"
},
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
}

View file

@ -770,40 +770,7 @@
}
},
{
"c": "(",
"t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "sed -nre 's/some regex with (group",
"t": "source.makefile string.interpolated.makefile variable.other.makefile",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": ")",
"t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "/\\1/p')",
"c": "(sed -nre 's/some regex with (group)/\\1/p')",
"t": "source.makefile",
"r": {
"dark_plus": "default: #D4D4D4",
@ -1937,18 +1904,29 @@
},
{
"c": "${",
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile variable.language.makefile",
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "variable.language: #569CD6",
"light_plus": "variable.language: #0000FF",
"dark_vs": "variable.language: #569CD6",
"light_vs": "variable.language: #0000FF",
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "ok",
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile variable.other.makefile",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": "ok}",
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile",
"c": "}",
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@ -1970,29 +1948,40 @@
},
{
"c": "${",
"t": "source.makefile variable.language.makefile",
"t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "variable.language: #569CD6",
"light_plus": "variable.language: #0000FF",
"dark_vs": "variable.language: #569CD6",
"light_vs": "variable.language: #0000FF",
"hc_black": "variable: #9CDCFE"
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "info Parentheses () in braces {()}: ",
"t": "source.makefile",
"c": "info",
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile support.function.info.makefile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "support.function: #DCDCAA",
"light_plus": "support.function: #795E26",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "support.function: #DCDCAA"
}
},
{
"c": " Parentheses () in braces {()}: ",
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "$(",
"t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@ -2003,7 +1992,7 @@
},
{
"c": "ok",
"t": "source.makefile string.interpolated.makefile variable.other.makefile",
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile variable.other.makefile",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
@ -2014,7 +2003,7 @@
},
{
"c": ")",
"t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
@ -2025,13 +2014,13 @@
},
{
"c": "}",
"t": "source.makefile",
"t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
@ -2058,17 +2047,39 @@
},
{
"c": "${",
"t": "source.makefile meta.scope.conditional.makefile meta.scope.condition.makefile variable.language.makefile",
"t": "source.makefile meta.scope.conditional.makefile meta.scope.condition.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "variable.language: #569CD6",
"light_plus": "variable.language: #0000FF",
"dark_vs": "variable.language: #569CD6",
"light_vs": "variable.language: #0000FF",
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "ok",
"t": "source.makefile meta.scope.conditional.makefile meta.scope.condition.makefile string.interpolated.makefile variable.other.makefile",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": "ok}\", \"skip\")",
"c": "}",
"t": "source.makefile meta.scope.conditional.makefile meta.scope.condition.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "\", \"skip\")",
"t": "source.makefile meta.scope.conditional.makefile meta.scope.condition.makefile",
"r": {
"dark_plus": "default: #D4D4D4",
@ -2146,17 +2157,39 @@
},
{
"c": "${",
"t": "source.makefile meta.scope.conditional.makefile variable.language.makefile",
"t": "source.makefile meta.scope.conditional.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "variable.language: #569CD6",
"light_plus": "variable.language: #0000FF",
"dark_vs": "variable.language: #569CD6",
"light_vs": "variable.language: #0000FF",
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "ok",
"t": "source.makefile meta.scope.conditional.makefile string.interpolated.makefile variable.other.makefile",
"r": {
"dark_plus": "variable: #9CDCFE",
"light_plus": "variable: #001080",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "variable: #9CDCFE"
}
},
{
"c": "ok}})",
"c": "}",
"t": "source.makefile meta.scope.conditional.makefile string.interpolated.makefile punctuation.definition.variable.makefile",
"r": {
"dark_plus": "string: #CE9178",
"light_plus": "string: #A31515",
"dark_vs": "string: #CE9178",
"light_vs": "string: #A31515",
"hc_black": "string: #CE9178"
}
},
{
"c": "})",
"t": "source.makefile meta.scope.conditional.makefile",
"r": {
"dark_plus": "default: #D4D4D4",