Update grammars

This commit is contained in:
Alex Ross
2019-05-16 10:17:43 -07:00
parent 40ae7f0312
commit 45db52ba6b
17 changed files with 1488 additions and 541 deletions

View File

@@ -6,11 +6,11 @@
"git": {
"name": "jeff-hykin/cpp-textmate-grammar",
"repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar",
"commitHash": "3fa2a8862b6a06ca381f8e46eb782e5dd014d426"
"commitHash": "dc404ccf4eb08a5f76434e759b519f59051a32e5"
}
},
"license": "MIT",
"version": "1.8.8",
"version": "1.8.13",
"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."
},
{

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/98cbae6aca391825a7612825f9677f22fe70dd68",
"version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/48734a7a8b365c12aeb7551aed0090b49601ed70",
"name": "C",
"scopeName": "source.c",
"patterns": [
@@ -570,13 +570,13 @@
}
},
"match": "^// =(\\s*.*?)\\s*=\\s*$\\n?",
"name": "comment.line.banner.cpp.c"
"name": "comment.line.banner.c"
},
{
"begin": "(^[ \\t]+)?(?=//)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.cpp.c"
"name": "punctuation.whitespace.comment.leading.c"
}
},
"end": "(?!\\G)",
@@ -585,11 +585,11 @@
"begin": "//",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.cpp.c"
"name": "punctuation.definition.comment.c"
}
},
"end": "(?=\\n)",
"name": "comment.line.double-slash.cpp.c",
"name": "comment.line.double-slash.c",
"patterns": [
{
"include": "#line_continuation_character"
@@ -624,14 +624,6 @@
}
]
},
"numbers": {
"patterns": [
{
"match": "\\b((0(x|X)[0-9a-fA-F]([0-9a-fA-F']*[0-9a-fA-F])?)|(0(b|B)[01]([01']*[01])?)|(([0-9]([0-9']*[0-9])?\\.?[0-9]*([0-9']*[0-9])?)|(\\.[0-9]([0-9']*[0-9])?))((e|E)(\\+|-)?[0-9]([0-9']*[0-9])?)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b",
"name": "constant.numeric.c"
}
]
},
"parens": {
"name": "meta.parens.c",
"begin": "\\(",
@@ -672,7 +664,7 @@
},
{
"match": "(?-mix:(?<!:):(?!:))",
"name": "punctuation.range-based.cpp.c"
"name": "punctuation.range-based.c"
}
]
},
@@ -2086,13 +2078,13 @@
"begin": "((?<!\\w)default(?!\\w))",
"beginCaptures": {
"1": {
"name": "keyword.control.default.cpp.c"
"name": "keyword.control.default.c"
}
},
"end": "(:)",
"endCaptures": {
"1": {
"name": "colon.cpp.c punctuation.separator.case.default.cpp.c"
"name": "colon.c punctuation.separator.case.default.c"
}
},
"patterns": [
@@ -2106,13 +2098,13 @@
"begin": "((?<!\\w)case(?!\\w))",
"beginCaptures": {
"1": {
"name": "keyword.control.case.cpp.c"
"name": "keyword.control.case.c"
}
},
"end": "(:)",
"endCaptures": {
"1": {
"name": "colon.cpp.c punctuation.separator.case.cpp.c"
"name": "colon.c punctuation.separator.case.c"
}
},
"patterns": [
@@ -2126,24 +2118,21 @@
"begin": "(((?<!\\w)switch(?!\\w)))",
"beginCaptures": {
"1": {
"name": "meta.head.switch.cpp.c"
"name": "meta.head.switch.c"
},
"2": {
"name": "keyword.control.switch.cpp.c"
"name": "keyword.control.switch.c"
}
},
"end": "(?:(?<=\\})|(?=[;>\\[\\]=]))",
"patterns": [
{
"include": "#switch_conditional_parentheses"
},
{
"name": "meta.head.switch.cpp.c",
"begin": "\\G| ",
"name": "meta.head.switch.c",
"begin": "\\G ?",
"end": "((?:\\{|(?=;)))",
"endCaptures": {
"1": {
"name": "punctuation.section.block.begin.bracket.curly.switch.cpp.c"
"name": "punctuation.section.block.begin.bracket.curly.switch.c"
}
},
"patterns": [
@@ -2156,12 +2145,12 @@
]
},
{
"name": "meta.body.switch.cpp.c",
"name": "meta.body.switch.c",
"begin": "(?<=\\{)",
"end": "(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.block.end.bracket.curly.switch.cpp.c"
"name": "punctuation.section.block.end.bracket.curly.switch.c"
}
},
"patterns": [
@@ -2177,7 +2166,7 @@
]
},
{
"name": "meta.tail.switch.cpp.c",
"name": "meta.tail.switch.c",
"begin": "(?<=})[\\s\\n]*",
"end": "[\\s\\n]*(?=;)",
"patterns": [
@@ -2193,13 +2182,13 @@
"begin": "(\\()",
"beginCaptures": {
"1": {
"name": "punctuation.section.parens.begin.bracket.round.conditional.switch.cpp.c"
"name": "punctuation.section.parens.begin.bracket.round.conditional.switch.c"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.parens.end.bracket.round.conditional.switch.cpp.c"
"name": "punctuation.section.parens.end.bracket.round.conditional.switch.c"
}
},
"patterns": [
@@ -2208,6 +2197,46 @@
}
]
},
"static_assert": {
"begin": "(static_assert|_Static_assert)\\s*(\\()",
"beginCaptures": {
"1": {
"name": "keyword.other.static_assert.c"
},
"2": {
"name": "punctuation.section.arguments.begin.bracket.round.c"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.arguments.end.bracket.round.c"
}
},
"patterns": [
{
"name": "meta.static_assert.message.c",
"begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)",
"beginCaptures": {
"1": {
"name": "comma.c punctuation.separator.delimiter.c"
}
},
"end": "(?=\\))",
"patterns": [
{
"include": "#string_context"
},
{
"include": "#string_context_c"
}
]
},
{
"include": "#function_call_context_c"
}
]
},
"conditional_context": {
"patterns": [
{
@@ -2311,6 +2340,250 @@
"include": "#function-call-innards"
}
]
},
"numbers": {
"begin": "(?<!\\w)(?=\\d|\\.\\d)",
"end": "(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
"patterns": [
{
"match": "(\\G0[xX])(?:([0-9a-fA-F](?:(?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?((?:(?<=[0-9a-fA-F])\\.|\\.(?=[0-9a-fA-F])))(?:([0-9a-fA-F](?:(?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?(?:((?<!')([pP])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:([lLfF](?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
"captures": {
"1": {
"name": "keyword.other.unit.hexadecimal.c"
},
"2": {
"name": "constant.numeric.hexadecimal.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric"
},
"4": {
"name": "constant.numeric.hexadecimal.c"
},
"5": {
"name": "constant.numeric.hexadecimal.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"6": {
"name": "punctuation.separator.constant.numeric"
},
"8": {
"name": "keyword.other.unit.exponent.hexadecimal.c"
},
"9": {
"name": "keyword.operator.plus.exponent.hexadecimal.c"
},
"10": {
"name": "keyword.operator.minus.exponent.hexadecimal.c"
},
"11": {
"name": "constant.numeric.exponent.hexadecimal.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"12": {
"name": "keyword.other.unit.suffix.floating-point.c"
}
}
},
{
"match": "(\\G(?=[0-9.])(?!0[xXbB]))(?:([0-9](?:(?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?((?:(?<=[0-9])\\.|\\.(?=[0-9])))(?:([0-9](?:(?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*))?(?:((?<!')([eE])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:([lLfF](?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
"captures": {
"2": {
"name": "constant.numeric.decimal.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric"
},
"4": {
"name": "constant.numeric.decimal.point.c"
},
"5": {
"name": "constant.numeric.decimal.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"6": {
"name": "punctuation.separator.constant.numeric"
},
"8": {
"name": "keyword.other.unit.exponent.decimal.c"
},
"9": {
"name": "keyword.operator.plus.exponent.decimal.c"
},
"10": {
"name": "keyword.operator.minus.exponent.decimal.c"
},
"11": {
"name": "constant.numeric.exponent.decimal.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"12": {
"name": "keyword.other.unit.suffix.floating-point.c"
}
}
},
{
"match": "(\\G0[bB])([01](?:(?:[01]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
"captures": {
"1": {
"name": "keyword.other.unit.binary.c"
},
"2": {
"name": "constant.numeric.binary.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric"
},
"4": {
"name": "keyword.other.unit.suffix.integer.c"
}
}
},
{
"match": "(\\G0)((?:(?:[0-7]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))+)(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
"captures": {
"1": {
"name": "keyword.other.unit.octal.c"
},
"2": {
"name": "constant.numeric.octal.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric"
},
"4": {
"name": "keyword.other.unit.suffix.integer.c"
}
}
},
{
"match": "(\\G0[xX])([0-9a-fA-F](?:(?:[0-9a-fA-F]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)(?:((?<!')([pP])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
"captures": {
"1": {
"name": "keyword.other.unit.hexadecimal.c"
},
"2": {
"name": "constant.numeric.hexadecimal.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric"
},
"5": {
"name": "keyword.other.unit.exponent.hexadecimal.c"
},
"6": {
"name": "keyword.operator.plus.exponent.hexadecimal.c"
},
"7": {
"name": "keyword.operator.minus.exponent.hexadecimal.c"
},
"8": {
"name": "constant.numeric.exponent.hexadecimal.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"9": {
"name": "keyword.other.unit.suffix.integer.c"
}
}
},
{
"match": "(\\G(?=[0-9.])(?!0[xXbB]))([0-9](?:(?:[0-9]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)(?:((?<!')([eE])(\\+)?(\\-)?((?-mix:(?:[0-9](?:(?:[0-9]|(?:(?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)))))?(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))",
"captures": {
"2": {
"name": "constant.numeric.decimal.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric"
},
"5": {
"name": "keyword.other.unit.exponent.decimal.c"
},
"6": {
"name": "keyword.operator.plus.exponent.decimal.c"
},
"7": {
"name": "keyword.operator.minus.exponent.decimal.c"
},
"8": {
"name": "constant.numeric.exponent.decimal.c",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric"
}
]
},
"9": {
"name": "keyword.other.unit.suffix.integer.c"
}
}
},
{
"match": "(?:(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))+",
"name": "invalid.illegal.constant.numeric"
}
]
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -848,7 +848,7 @@
},
{
"c": "4",
"t": "source.c meta.block.c constant.numeric.c",
"t": "source.c meta.block.c constant.numeric.decimal.c",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #09885A",
@@ -980,7 +980,7 @@
},
{
"c": "0",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #09885A",
@@ -1178,7 +1178,7 @@
},
{
"c": "2",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #09885A",
@@ -1387,7 +1387,7 @@
},
{
"c": "2",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #09885A",
@@ -1717,7 +1717,7 @@
},
{
"c": "0",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #09885A",
@@ -1860,7 +1860,7 @@
},
{
"c": "2",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #09885A",
@@ -2223,7 +2223,7 @@
},
{
"c": "2",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #09885A",
@@ -2388,7 +2388,7 @@
},
{
"c": "2",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.c",
"t": "source.c meta.block.c meta.parens.block.c constant.numeric.decimal.c",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #09885A",
@@ -2762,7 +2762,7 @@
},
{
"c": "0",
"t": "source.c meta.block.c constant.numeric.c",
"t": "source.c meta.block.c constant.numeric.decimal.c",
"r": {
"dark_plus": "constant.numeric: #B5CEA8",
"light_plus": "constant.numeric: #09885A",

View File

@@ -286,8 +286,19 @@
}
},
{
"c": "public:",
"t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public:.cpp",
"c": "public",
"t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public.cpp",
"r": {
"dark_plus": "storage.type: #569CD6",
"light_plus": "storage.type: #0000FF",
"dark_vs": "storage.type: #569CD6",
"light_vs": "storage.type: #0000FF",
"hc_black": "storage.type: #569CD6"
}
},
{
"c": ":",
"t": "source.cpp meta.block.class.cpp meta.body.class.cpp storage.type.modifier.access.control.public.cpp colon.cpp",
"r": {
"dark_plus": "storage.type: #569CD6",
"light_plus": "storage.type: #0000FF",