Skip to content

Commit

Permalink
Update grammars
Browse files Browse the repository at this point in the history
  • Loading branch information
alexr00 committed Aug 5, 2019
1 parent 6352696 commit edf34d3
Show file tree
Hide file tree
Showing 17 changed files with 3,215 additions and 1,269 deletions.
4 changes: 2 additions & 2 deletions extensions/cpp/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"git": {
"name": "jeff-hykin/cpp-textmate-grammar",
"repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar",
"commitHash": "992c5ba8789288707f2a13778452d644677d9699"
"commitHash": "cbd71f90cd9be0f99ddc9b0f65cec62fc3ada6d1"
}
},
"license": "MIT",
"version": "1.12.18",
"version": "1.12.21",
"description": "The files syntaxes/c.json and syntaxes/c++.json were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle."
},
{
Expand Down
90 changes: 76 additions & 14 deletions extensions/cpp/syntaxes/c.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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))",
Expand Down Expand Up @@ -520,7 +582,7 @@
"include": "#switch_conditional_parentheses"
},
{
"include": "$base"
"include": "$self"
}
]
},
Expand All @@ -541,7 +603,7 @@
"include": "#case_statement"
},
{
"include": "$base"
"include": "$self"
},
{
"include": "#block_innards"
Expand All @@ -554,7 +616,7 @@
"end": "[\\s\\n]*(?=;)",
"patterns": [
{
"include": "$base"
"include": "$self"
}
]
}
Expand Down Expand Up @@ -705,7 +767,7 @@
"c_conditional_context": {
"patterns": [
{
"include": "$base"
"include": "$self"
},
{
"include": "#block_innards"
Expand Down
Loading

0 comments on commit edf34d3

Please sign in to comment.