Update grammars

This commit is contained in:
Alex Ross
2019-08-05 12:44:23 +02:00
parent 63526965e2
commit edf34d3931
17 changed files with 3421 additions and 1475 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/jeff-hykin/cpp-textmate-grammar/commit/1a24b4aa383169919f0d92cf2735ac35a3e7db3c",
"version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/5209e7f9df7661db6f163753141eeb3de6fb02b3",
"name": "C",
"scopeName": "source.c",
"patterns": [
@@ -67,32 +67,71 @@
"include": "#strings"
},
{
"begin": "(?x)\n^\\s* ((\\#)\\s*define) \\s+\t# define\n((?<id>[a-zA-Z_$][\\w$]*))\t # macro name\n(?:\n (\\()\n\t(\n\t \\s* \\g<id> \\s*\t\t # first argument\n\t ((,) \\s* \\g<id> \\s*)* # additional arguments\n\t (?:\\.\\.\\.)?\t\t\t# varargs ellipsis?\n\t)\n (\\))\n)?",
"name": "meta.preprocessor.macro.c",
"begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((#)\\s*define\\b)\\s+((?<!\\w)[a-zA-Z_]\\w*(?!\\w))(?:(\\()([^()\\\\]+)(\\)))?",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.define.c"
"patterns": [
{
"include": "#inline_comment"
}
]
},
"2": {
"name": "punctuation.definition.directive.c"
"name": "comment.block.c punctuation.definition.comment.begin.c"
},
"3": {
"name": "entity.name.function.preprocessor.c"
"name": "comment.block.c"
},
"4": {
"patterns": [
{
"match": "\\*\\/",
"name": "comment.block.c punctuation.definition.comment.end.c"
},
{
"match": "\\*",
"name": "comment.block.c"
}
]
},
"5": {
"name": "punctuation.definition.parameters.begin.c"
"name": "keyword.control.directive.define.c"
},
"6": {
"name": "variable.parameter.preprocessor.c"
"name": "punctuation.definition.directive.c"
},
"7": {
"name": "entity.name.function.preprocessor.c"
},
"8": {
"name": "punctuation.separator.parameters.c"
"name": "punctuation.definition.parameters.begin.c"
},
"9": {
"patterns": [
{
"match": "(?<=[(,])\\s*((?<!\\w)[a-zA-Z_]\\w*(?!\\w))\\s*",
"captures": {
"1": {
"name": "variable.parameter.preprocessor.c"
}
}
},
{
"match": ",",
"name": "punctuation.separator.parameters.c"
},
{
"match": "\\.\\.\\.",
"name": "ellipses.c punctuation.vararg-ellipses.variable.parameter.preprocessor.c"
}
]
},
"10": {
"name": "punctuation.definition.parameters.end.c"
}
},
"end": "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.macro.c",
"end": "(?<!\\\\)(?=\\n)",
"patterns": [
{
"include": "#preprocessor-rule-define-line-contents"
@@ -372,6 +411,29 @@
}
],
"repository": {
"inline_comment": {
"match": "(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/))",
"captures": {
"1": {
"name": "comment.block.c punctuation.definition.comment.begin.c"
},
"2": {
"name": "comment.block.c"
},
"3": {
"patterns": [
{
"match": "\\*\\/",
"name": "comment.block.c punctuation.definition.comment.end.c"
},
{
"match": "\\*",
"name": "comment.block.c"
}
]
}
}
},
"default_statement": {
"name": "meta.conditional.case.c",
"begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?<!\\w)default(?!\\w))",
@@ -520,7 +582,7 @@
"include": "#switch_conditional_parentheses"
},
{
"include": "$base"
"include": "$self"
}
]
},
@@ -541,7 +603,7 @@
"include": "#case_statement"
},
{
"include": "$base"
"include": "$self"
},
{
"include": "#block_innards"
@@ -554,7 +616,7 @@
"end": "[\\s\\n]*(?=;)",
"patterns": [
{
"include": "$base"
"include": "$self"
}
]
}
@@ -705,7 +767,7 @@
"c_conditional_context": {
"patterns": [
{
"include": "$base"
"include": "$self"
},
{
"include": "#block_innards"

File diff suppressed because one or more lines are too long