提交 8200277b 编写于 作者: A Alex Ross

Update C++ grammar to get * fix

There is a known bug for macros, but it is better to get the * fix and pick up the macro fix as soon as it is made.
上级 64031a23
......@@ -6,7 +6,7 @@
"git": {
"name": "jeff-hykin/cpp-textmate-grammar",
"repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar",
"commitHash": "59f0673f04d6e5c8a4d1b3ccc5235ed8a4ccb6c0"
"commitHash": "cb9cb59b32d0cb9e2cbbca1a9cdb62769fc2ca8e"
}
},
"license": "MIT",
......
......@@ -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/9c4f4b3291538d9f5144f02d3b6af877b84f2cb2",
"version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/1a24b4aa383169919f0d92cf2735ac35a3e7db3c",
"name": "C",
"scopeName": "source.c",
"patterns": [
......@@ -374,16 +374,41 @@
"repository": {
"default_statement": {
"name": "meta.conditional.case.c",
"begin": "((?<!\\w)default(?!\\w))",
"begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?<!\\w)default(?!\\w))",
"beginCaptures": {
"1": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"2": {
"name": "comment.block.c punctuation.definition.comment.begin.c"
},
"3": {
"name": "comment.block.c"
},
"4": {
"patterns": [
{
"match": "\\*\\/",
"name": "comment.block.c punctuation.definition.comment.end.c"
},
{
"match": "\\*",
"name": "comment.block.c"
}
]
},
"5": {
"name": "keyword.control.default.c"
}
},
"end": "(:)",
"endCaptures": {
"1": {
"name": "colon.c punctuation.separator.case.default.c"
"name": "punctuation.separator.colon.case.default.c"
}
},
"patterns": [
......@@ -397,16 +422,41 @@
},
"case_statement": {
"name": "meta.conditional.case.c",
"begin": "((?<!\\w)case(?!\\w))",
"begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?<!\\w)case(?!\\w))",
"beginCaptures": {
"1": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"2": {
"name": "comment.block.c punctuation.definition.comment.begin.c"
},
"3": {
"name": "comment.block.c"
},
"4": {
"patterns": [
{
"match": "\\*\\/",
"name": "comment.block.c punctuation.definition.comment.end.c"
},
{
"match": "\\*",
"name": "comment.block.c"
}
]
},
"5": {
"name": "keyword.control.case.c"
}
},
"end": "(:)",
"endCaptures": {
"1": {
"name": "colon.c punctuation.separator.case.c"
"name": "punctuation.separator.colon.case.c"
}
},
"patterns": [
......@@ -420,12 +470,37 @@
},
"switch_statement": {
"name": "meta.block.switch.c",
"begin": "(((?<!\\w)switch(?!\\w)))",
"begin": "(((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))((?<!\\w)switch(?!\\w)))",
"beginCaptures": {
"1": {
"name": "meta.head.switch.c"
},
"2": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"3": {
"name": "comment.block.c punctuation.definition.comment.begin.c"
},
"4": {
"name": "comment.block.c"
},
"5": {
"patterns": [
{
"match": "\\*\\/",
"name": "comment.block.c punctuation.definition.comment.end.c"
},
{
"match": "\\*",
"name": "comment.block.c"
}
]
},
"6": {
"name": "keyword.control.switch.c"
}
},
......@@ -487,9 +562,34 @@
},
"switch_conditional_parentheses": {
"name": "meta.conditional.switch.c",
"begin": "(\\()",
"begin": "((?:(?:(?>\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+?|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z)))(\\()",
"beginCaptures": {
"1": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"2": {
"name": "comment.block.c punctuation.definition.comment.begin.c"
},
"3": {
"name": "comment.block.c"
},
"4": {
"patterns": [
{
"match": "\\*\\/",
"name": "comment.block.c punctuation.definition.comment.end.c"
},
{
"match": "\\*",
"name": "comment.block.c"
}
]
},
"5": {
"name": "punctuation.section.parens.begin.bracket.round.conditional.switch.c"
}
},
......@@ -580,7 +680,7 @@
"begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)",
"beginCaptures": {
"1": {
"name": "comma.c punctuation.separator.delimiter.c"
"name": "punctuation.separator.delimiter.comma.c"
}
},
"end": "(?=\\))",
......
[
{
"c": "#",
"t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp",
"t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......@@ -12,7 +12,7 @@
},
{
"c": "ifndef",
"t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp",
"t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......@@ -23,7 +23,7 @@
},
{
"c": " ",
"t": "source.cpp source.cpp meta.preprocessor.cpp",
"t": "source.cpp meta.preprocessor.cpp",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
......@@ -34,7 +34,7 @@
},
{
"c": "_UCRT",
"t": "source.cpp source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp",
"t": "source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
......@@ -45,7 +45,7 @@
},
{
"c": " ",
"t": "source.cpp source.cpp meta.preprocessor.macro.cpp",
"t": "source.cpp meta.preprocessor.macro.cpp",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
......@@ -56,7 +56,7 @@
},
{
"c": "#",
"t": "source.cpp source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp punctuation.definition.directive.cpp",
"t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......@@ -67,7 +67,7 @@
},
{
"c": "define",
"t": "source.cpp source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp",
"t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......@@ -78,7 +78,7 @@
},
{
"c": " ",
"t": "source.cpp source.cpp meta.preprocessor.macro.cpp",
"t": "source.cpp meta.preprocessor.macro.cpp",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
......@@ -89,7 +89,7 @@
},
{
"c": "_UCRT",
"t": "source.cpp source.cpp meta.preprocessor.macro.cpp entity.name.function.preprocessor.cpp",
"t": "source.cpp meta.preprocessor.macro.cpp entity.name.function.preprocessor.cpp",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
......@@ -100,7 +100,7 @@
},
{
"c": "#",
"t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp",
"t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......@@ -111,7 +111,7 @@
},
{
"c": "endif",
"t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp",
"t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......
[
{
"c": "#",
"t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp",
"t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......@@ -12,7 +12,7 @@
},
{
"c": "ifndef",
"t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp",
"t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......@@ -23,7 +23,7 @@
},
{
"c": " ",
"t": "source.cpp source.cpp meta.preprocessor.cpp",
"t": "source.cpp meta.preprocessor.cpp",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
......@@ -34,7 +34,7 @@
},
{
"c": "_UCRT",
"t": "source.cpp source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp",
"t": "source.cpp meta.preprocessor.cpp entity.name.function.preprocessor.cpp",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
......@@ -45,7 +45,7 @@
},
{
"c": "#",
"t": "source.cpp source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp punctuation.definition.directive.cpp",
"t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......@@ -56,7 +56,7 @@
},
{
"c": "define",
"t": "source.cpp source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp",
"t": "source.cpp meta.preprocessor.macro.cpp keyword.control.directive.define.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......@@ -67,7 +67,7 @@
},
{
"c": " ",
"t": "source.cpp source.cpp meta.preprocessor.macro.cpp",
"t": "source.cpp meta.preprocessor.macro.cpp",
"r": {
"dark_plus": "meta.preprocessor: #569CD6",
"light_plus": "meta.preprocessor: #0000FF",
......@@ -78,7 +78,7 @@
},
{
"c": "_UCRT",
"t": "source.cpp source.cpp meta.preprocessor.macro.cpp entity.name.function.preprocessor.cpp",
"t": "source.cpp meta.preprocessor.macro.cpp entity.name.function.preprocessor.cpp",
"r": {
"dark_plus": "entity.name.function: #DCDCAA",
"light_plus": "entity.name.function: #795E26",
......@@ -89,7 +89,7 @@
},
{
"c": "#",
"t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp",
"t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp punctuation.definition.directive.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......@@ -100,7 +100,7 @@
},
{
"c": "endif",
"t": "source.cpp source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp",
"t": "source.cpp meta.preprocessor.cpp keyword.control.directive.conditional.cpp",
"r": {
"dark_plus": "keyword.control: #C586C0",
"light_plus": "keyword.control: #AF00DB",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册