vscode/extensions/cpp/syntaxes/cpp.tmLanguage.json
2019-05-21 11:19:36 +02:00

4765 lines
133 KiB
JSON

{
"information_for_contributors": [
"This file has been converted from https://github.com/jeff-hykin/cpp-textmate-grammar/blob/master//syntaxes/cpp.tmLanguage.json",
"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/cd181fc3a13d2a58686969326cba1173f56d5593",
"name": "C++",
"scopeName": "source.cpp",
"patterns": [
{
"include": "#struct_declare"
},
{
"include": "#special_block_context"
},
{
"include": "#macro_argument"
},
{
"include": "#string_context"
},
{
"include": "#functional_specifiers_pre_parameters"
},
{
"include": "#qualifiers_and_specifiers_post_parameters"
},
{
"include": "#storage_specifiers"
},
{
"include": "#access_control_keywords"
},
{
"include": "#exception_keywords"
},
{
"include": "#static_assert"
},
{
"include": "#other_keywords"
},
{
"include": "#memory_operators"
},
{
"include": "#the_this_keyword"
},
{
"include": "#language_constants"
},
{
"include": "#template_isolated_definition"
},
{
"include": "#template_definition"
},
{
"include": "#scope_resolution"
},
{
"include": "#misc_storage_modifiers_1"
},
{
"include": "#destructor"
},
{
"include": "#destructor_prototype"
},
{
"include": "#lambdas"
},
{
"include": "#preprocessor_context"
},
{
"include": "#comments_context"
},
{
"include": "#switch_statement"
},
{
"include": "#control_flow_keywords"
},
{
"include": "#storage_types"
},
{
"include": "#assembly"
},
{
"include": "#misc_storage_modifiers_2"
},
{
"include": "#operator_overload"
},
{
"include": "#number_literal"
},
{
"include": "#string_context_c"
},
{
"include": "#meta_preprocessor_macro"
},
{
"include": "#meta_preprocessor_diagnostic"
},
{
"include": "#meta_preprocessor_include"
},
{
"include": "#pragma_mark"
},
{
"include": "#meta_preprocessor_line"
},
{
"include": "#meta_preprocessor_undef"
},
{
"include": "#meta_preprocessor_pragma"
},
{
"include": "#operators"
},
{
"include": "#block"
},
{
"include": "#parentheses"
},
{
"include": "#function_definition"
},
{
"include": "#line_continuation_character"
},
{
"include": "#square_brackets"
},
{
"include": "#empty_square_brackets"
},
{
"include": "#semicolon"
},
{
"include": "#comma"
}
],
"repository": {
"sizeof_operator": {
"contentName": "meta.arguments.operator.sizeof",
"begin": "((?<!\\w)sizeof(?!\\w))(\\()",
"beginCaptures": {
"1": {
"name": "keyword.operator.functionlike.cpp keyword.operator.sizeof.cpp"
},
"2": {
"name": "punctuation.section.arguments.begin.bracket.round.operator.sizeof.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.arguments.end.bracket.round.operator.sizeof.cpp"
}
},
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"alignof_operator": {
"contentName": "meta.arguments.operator.alignof",
"begin": "((?<!\\w)alignof(?!\\w))(\\()",
"beginCaptures": {
"1": {
"name": "keyword.operator.functionlike.cpp keyword.operator.alignof.cpp"
},
"2": {
"name": "punctuation.section.arguments.begin.bracket.round.operator.alignof.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.arguments.end.bracket.round.operator.alignof.cpp"
}
},
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"alignas_operator": {
"contentName": "meta.arguments.operator.alignas",
"begin": "((?<!\\w)alignas(?!\\w))(\\()",
"beginCaptures": {
"1": {
"name": "keyword.operator.functionlike.cpp keyword.operator.alignas.cpp"
},
"2": {
"name": "punctuation.section.arguments.begin.bracket.round.operator.alignas.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.arguments.end.bracket.round.operator.alignas.cpp"
}
},
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"typeid_operator": {
"contentName": "meta.arguments.operator.typeid",
"begin": "((?<!\\w)typeid(?!\\w))(\\()",
"beginCaptures": {
"1": {
"name": "keyword.operator.functionlike.cpp keyword.operator.typeid.cpp"
},
"2": {
"name": "punctuation.section.arguments.begin.bracket.round.operator.typeid.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.arguments.end.bracket.round.operator.typeid.cpp"
}
},
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"decltype_specifier": {
"contentName": "meta.arguments.decltype",
"begin": "((?<!\\w)decltype(?!\\w))(\\()",
"beginCaptures": {
"1": {
"name": "keyword.operator.functionlike.cpp keyword.other.decltype.cpp storage.type.decltype.cpp"
},
"2": {
"name": "punctuation.section.arguments.begin.bracket.round.decltype.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.arguments.end.bracket.round.decltype.cpp"
}
},
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"semicolon": {
"match": ";",
"name": "punctuation.terminator.statement.cpp"
},
"comma": {
"match": ",",
"name": "comma.cpp punctuation.separator.delimiter.cpp"
},
"assignment_operator": {
"match": "\\=",
"name": "keyword.operator.assignment.cpp"
},
"preprocessor_context": {
"patterns": [
{
"include": "#preprocessor_rule_enabled"
},
{
"include": "#preprocessor_rule_disabled"
},
{
"include": "#preprocessor_rule_conditional"
},
{
"include": "#hacky_fix_for_stray_directive"
}
]
},
"storage_types": {
"patterns": [
{
"include": "#primitive_types"
},
{
"include": "#non_primitive_types"
},
{
"include": "#pthread_types"
},
{
"include": "#posix_reserved_types"
}
]
},
"evaluation_context": {
"patterns": [
{
"include": "$base"
}
]
},
"conditional_context": {
"patterns": [
{
"include": "$base"
}
]
},
"template_definition_context": {
"patterns": [
{
"include": "#scope_resolution"
},
{
"include": "#template_definition_argument"
},
{
"include": "#template_argument_defaulted"
},
{
"include": "#template_call_innards"
},
{
"include": "#evaluation_context"
}
]
},
"template_call_context": {
"patterns": [
{
"include": "#storage_types"
},
{
"include": "#language_constants"
},
{
"include": "#scope_resolution"
},
{
"include": "#user_defined_template_type"
},
{
"include": "#operators"
},
{
"include": "#number_literal"
},
{
"include": "#string_context"
},
{
"include": "#comma_in_template_argument"
}
]
},
"attributes_context": {
"patterns": [
{
"include": "#cpp_attributes"
},
{
"include": "#gcc_attributes"
},
{
"include": "#ms_attributes"
},
{
"include": "#alignas_attribute"
}
]
},
"number_literal": {
"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)))?((?:\\w(?<![0-9a-fA-FpP])\\w*)?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-])))",
"captures": {
"1": {
"name": "keyword.other.unit.hexadecimal.cpp"
},
"2": {
"name": "constant.numeric.hexadecimal.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric.cpp"
},
"4": {
"name": "constant.numeric.hexadecimal.cpp"
},
"5": {
"name": "constant.numeric.hexadecimal.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"6": {
"name": "punctuation.separator.constant.numeric.cpp"
},
"8": {
"name": "keyword.other.unit.exponent.hexadecimal.cpp"
},
"9": {
"name": "keyword.operator.plus.exponent.hexadecimal.cpp"
},
"10": {
"name": "keyword.operator.minus.exponent.hexadecimal.cpp"
},
"11": {
"name": "constant.numeric.exponent.hexadecimal.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"12": {
"name": "keyword.other.unit.suffix.floating-point.cpp"
},
"13": {
"name": "keyword.other.unit.user-defined.cpp"
}
}
},
{
"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)))?((?:\\w(?<![0-9eE])\\w*)?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-])))",
"captures": {
"2": {
"name": "constant.numeric.decimal.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric.cpp"
},
"4": {
"name": "constant.numeric.decimal.point.cpp"
},
"5": {
"name": "constant.numeric.decimal.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"6": {
"name": "punctuation.separator.constant.numeric.cpp"
},
"8": {
"name": "keyword.other.unit.exponent.decimal.cpp"
},
"9": {
"name": "keyword.operator.plus.exponent.decimal.cpp"
},
"10": {
"name": "keyword.operator.minus.exponent.decimal.cpp"
},
"11": {
"name": "constant.numeric.exponent.decimal.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"12": {
"name": "keyword.other.unit.suffix.floating-point.cpp"
},
"13": {
"name": "keyword.other.unit.user-defined.cpp"
}
}
},
{
"match": "(\\G0[bB])([01](?:(?:[01]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))*)(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?((?:\\w(?<![0-9])\\w*)?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-])))",
"captures": {
"1": {
"name": "keyword.other.unit.binary.cpp"
},
"2": {
"name": "constant.numeric.binary.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric.cpp"
},
"4": {
"name": "keyword.other.unit.suffix.integer.cpp"
},
"5": {
"name": "keyword.other.unit.user-defined.cpp"
}
}
},
{
"match": "(\\G0)((?:(?:[0-7]|((?<=[0-9a-fA-F])'(?=[0-9a-fA-F]))))+)(?:((?:(?:(?:(?:(?:[uU]|[uU]ll?)|[uU]LL?)|ll?[uU]?)|LL?[uU]?)|[fF])(?!\\w)))?((?:\\w(?<![0-9])\\w*)?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-])))",
"captures": {
"1": {
"name": "keyword.other.unit.octal.cpp"
},
"2": {
"name": "constant.numeric.octal.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric.cpp"
},
"4": {
"name": "keyword.other.unit.suffix.integer.cpp"
},
"5": {
"name": "keyword.other.unit.user-defined.cpp"
}
}
},
{
"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)))?((?:\\w(?<![0-9a-fA-FpP])\\w*)?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-])))",
"captures": {
"1": {
"name": "keyword.other.unit.hexadecimal.cpp"
},
"2": {
"name": "constant.numeric.hexadecimal.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric.cpp"
},
"5": {
"name": "keyword.other.unit.exponent.hexadecimal.cpp"
},
"6": {
"name": "keyword.operator.plus.exponent.hexadecimal.cpp"
},
"7": {
"name": "keyword.operator.minus.exponent.hexadecimal.cpp"
},
"8": {
"name": "constant.numeric.exponent.hexadecimal.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"9": {
"name": "keyword.other.unit.suffix.integer.cpp"
},
"10": {
"name": "keyword.other.unit.user-defined.cpp"
}
}
},
{
"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)))?((?:\\w(?<![0-9eE])\\w*)?(?!(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-])))",
"captures": {
"2": {
"name": "constant.numeric.decimal.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"3": {
"name": "punctuation.separator.constant.numeric.cpp"
},
"5": {
"name": "keyword.other.unit.exponent.decimal.cpp"
},
"6": {
"name": "keyword.operator.plus.exponent.decimal.cpp"
},
"7": {
"name": "keyword.operator.minus.exponent.decimal.cpp"
},
"8": {
"name": "constant.numeric.exponent.decimal.cpp",
"patterns": [
{
"match": "(?<=[0-9a-fA-F])'(?=[0-9a-fA-F])",
"name": "punctuation.separator.constant.numeric.cpp"
}
]
},
"9": {
"name": "keyword.other.unit.suffix.integer.cpp"
},
"10": {
"name": "keyword.other.unit.user-defined.cpp"
}
}
},
{
"match": "(?:(?:['0-9a-zA-Z_\\.']|(?<=[eEpP])[+-]))+",
"name": "invalid.illegal.constant.numeric.cpp"
}
]
},
"language_constants": {
"match": "(?<!\\w)(?:NULL|true|false|nullptr)(?!\\w)",
"name": "constant.language.$0.cpp"
},
"primitive_types": {
"match": "(?<!\\w)(?:auto|void|char|short|int|signed|unsigned|long|float|double|bool|wchar_t)(?!\\w)",
"name": "storage.type.primitive.cpp"
},
"non_primitive_types": {
"match": "(?<!\\w)(?:u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t)(?!\\w)",
"name": "storage.type.cpp"
},
"functional_specifiers_pre_parameters": {
"match": "(?<!\\w)(?:inline|constexpr|mutable|friend|explicit|virtual)(?!\\w)",
"name": "storage.modifier.specificer.functional.pre-parameters.$0.cpp"
},
"qualifiers_and_specifiers_post_parameters": {
"match": "(?<!\\w)(?:final|override|volatile|const|noexcept)(?!\\w)(?=\\s*(?:(?:\\{|;)|[\\n\\r]))",
"name": "storage.modifier.specifier.functional.post-parameters.$0.cpp"
},
"storage_specifiers": {
"match": "(?<!\\w)(?:const|static|volatile|register|restrict|extern)(?!\\w)",
"name": "storage.modifier.specifier.$0.cpp"
},
"access_control_keywords": {
"match": "(?<!\\w)((?:private|protected|public))\\s*(:)",
"captures": {
"2": {
"name": "colon.cpp"
}
},
"name": "storage.type.modifier.access.control.$1.cpp"
},
"exception_keywords": {
"match": "(?<!\\w)(?:throw|try|catch)(?!\\w)",
"name": "keyword.control.exception.$0.cpp"
},
"other_keywords": {
"match": "(?<!\\w)(using|typedef)(?!\\w)",
"name": "keyword.other.$0.cpp"
},
"the_this_keyword": {
"match": "(?<!\\w)this(?!\\w)",
"name": "variable.language.this.cpp"
},
"memory_operators": {
"match": "(?<!\\w)(?:(?:(delete)\\s*(\\[\\])|(delete))|(new))(?!\\w)",
"captures": {
"1": {
"name": "keyword.operator.delete.array.cpp"
},
"2": {
"name": "keyword.operator.delete.array.bracket.cpp"
},
"3": {
"name": "keyword.operator.delete.cpp"
},
"4": {
"name": "keyword.operator.new.cpp"
}
},
"name": "keyword.operator.wordlike.cpp memory.cpp"
},
"control_flow_keywords": {
"match": "(?<!\\w)(?:throw|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default)(?!\\w)",
"name": "keyword.control.$0.cpp"
},
"default_statement": {
"name": "meta.conditional.case.cpp",
"begin": "((?<!\\w)default(?!\\w))",
"beginCaptures": {
"1": {
"name": "keyword.control.default.cpp"
}
},
"end": "(:)",
"endCaptures": {
"1": {
"name": "colon.cpp punctuation.separator.case.default.cpp"
}
},
"patterns": [
{
"include": "#conditional_context"
}
]
},
"case_statement": {
"name": "meta.conditional.case.cpp",
"begin": "((?<!\\w)case(?!\\w))",
"beginCaptures": {
"1": {
"name": "keyword.control.case.cpp"
}
},
"end": "(:)",
"endCaptures": {
"1": {
"name": "colon.cpp punctuation.separator.case.cpp"
}
},
"patterns": [
{
"include": "#conditional_context"
}
]
},
"switch_conditional_parentheses": {
"name": "meta.conditional.switch.cpp",
"begin": "(\\()",
"beginCaptures": {
"1": {
"name": "punctuation.section.parens.begin.bracket.round.conditional.switch.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.parens.end.bracket.round.conditional.switch.cpp"
}
},
"patterns": [
{
"include": "#conditional_context"
}
]
},
"switch_statement": {
"name": "meta.block.switch.cpp",
"begin": "(((?<!\\w)switch(?!\\w)))",
"beginCaptures": {
"1": {
"name": "meta.head.switch.cpp"
},
"2": {
"name": "keyword.control.switch.cpp"
}
},
"end": "(?:(?<=\\})|(?=[;>\\[\\]=]))",
"patterns": [
{
"name": "meta.head.switch.cpp",
"begin": "\\G ?",
"end": "((?:\\{|(?=;)))",
"endCaptures": {
"1": {
"name": "punctuation.section.block.begin.bracket.curly.switch.cpp"
}
},
"patterns": [
{
"include": "#switch_conditional_parentheses"
},
{
"include": "$base"
}
]
},
{
"name": "meta.body.switch.cpp",
"begin": "(?<=\\{)",
"end": "(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.block.end.bracket.curly.switch.cpp"
}
},
"patterns": [
{
"include": "#default_statement"
},
{
"include": "#case_statement"
},
{
"include": "$base"
},
{
"include": "#block_innards"
}
]
},
{
"name": "meta.tail.switch.cpp",
"begin": "(?<=})[\\s\\n]*",
"end": "[\\s\\n]*(?=;)",
"patterns": [
{
"include": "$base"
}
]
}
]
},
"cpp_attributes": {
"name": "support.other.attribute.cpp",
"begin": "(\\[\\[)",
"beginCaptures": {
"1": {
"name": "punctuation.section.attribute.begin.cpp"
}
},
"end": "(\\]\\])",
"endCaptures": {
"1": {
"name": "punctuation.section.attribute.end.cpp"
}
},
"patterns": [
{
"include": "#attributes_context"
},
{
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#string_context_c"
}
]
},
{
"match": "(using)\\s+((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))",
"captures": {
"1": {
"name": "keyword.other.using.directive.cpp"
},
"2": {
"name": "entity.name.type.namespace.cpp"
}
}
},
{
"match": ",",
"name": "punctuation.separator.attribute.cpp"
},
{
"match": ":",
"name": "punctuation.accessor.attribute.cpp"
},
{
"match": "(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)(?=::)",
"name": "entity.name.type.namespace.cpp"
},
{
"match": "(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)",
"name": "entity.other.attribute.$0.cpp"
},
{
"include": "#number_literal"
}
]
},
"gcc_attributes": {
"name": "support.other.attribute.cpp",
"begin": "(__attribute\\(\\()",
"beginCaptures": {
"1": {
"name": "punctuation.section.attribute.begin.cpp"
}
},
"end": "(\\)\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.attribute.end.cpp"
}
},
"patterns": [
{
"include": "#attributes_context"
},
{
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#string_context_c"
}
]
},
{
"match": "(using)\\s+((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))",
"captures": {
"1": {
"name": "keyword.other.using.directive.cpp"
},
"2": {
"name": "entity.name.type.namespace.cpp"
}
}
},
{
"match": ",",
"name": "punctuation.separator.attribute.cpp"
},
{
"match": ":",
"name": "punctuation.accessor.attribute.cpp"
},
{
"match": "(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)(?=::)",
"name": "entity.name.type.namespace.cpp"
},
{
"match": "(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)",
"name": "entity.other.attribute.$0.cpp"
},
{
"include": "#number_literal"
}
]
},
"ms_attributes": {
"name": "support.other.attribute.cpp",
"begin": "(__declspec\\()",
"beginCaptures": {
"1": {
"name": "punctuation.section.attribute.begin.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.attribute.end.cpp"
}
},
"patterns": [
{
"include": "#attributes_context"
},
{
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#string_context_c"
}
]
},
{
"match": "(using)\\s+((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))",
"captures": {
"1": {
"name": "keyword.other.using.directive.cpp"
},
"2": {
"name": "entity.name.type.namespace.cpp"
}
}
},
{
"match": ",",
"name": "punctuation.separator.attribute.cpp"
},
{
"match": ":",
"name": "punctuation.accessor.attribute.cpp"
},
{
"match": "(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)(?=::)",
"name": "entity.name.type.namespace.cpp"
},
{
"match": "(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)",
"name": "entity.other.attribute.$0.cpp"
},
{
"include": "#number_literal"
}
]
},
"alignas_attribute": {
"name": "support.other.attribute.cpp",
"begin": "(alignas\\()",
"beginCaptures": {
"1": {
"name": "punctuation.section.attribute.begin.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.attribute.end.cpp"
}
},
"patterns": [
{
"include": "#attributes_context"
},
{
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#string_context_c"
}
]
},
{
"match": "(using)\\s+((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))",
"captures": {
"1": {
"name": "keyword.other.using.directive.cpp"
},
"2": {
"name": "entity.name.type.namespace.cpp"
}
}
},
{
"match": ",",
"name": "punctuation.separator.attribute.cpp"
},
{
"match": ":",
"name": "punctuation.accessor.attribute.cpp"
},
{
"match": "(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)(?=::)",
"name": "entity.name.type.namespace.cpp"
},
{
"match": "(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)",
"name": "entity.other.attribute.$0.cpp"
},
{
"include": "#number_literal"
}
]
},
"user_defined_template_type": {
"match": "(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)",
"name": "storage.type.user-defined.cpp"
},
"comma_in_template_argument": {
"match": ",",
"name": "comma.cpp punctuation.separator.template.argument.cpp"
},
"template_call_innards": {
"match": "(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*",
"captures": {
"0": {
"name": "meta.template.call.cpp",
"patterns": [
{
"include": "#template_call_context"
}
]
}
}
},
"template_call_range": {
"name": "meta.template.call.cpp",
"begin": "(<)",
"beginCaptures": {
"1": {
"name": "punctuation.section.angle-brackets.begin.template.call.cpp"
}
},
"end": "(>)",
"endCaptures": {
"1": {
"name": "punctuation.section.angle-brackets.end.template.call.cpp"
}
},
"patterns": [
{
"include": "#template_call_context"
}
]
},
"template_isolated_definition": {
"match": "(?<!\\w)(template)\\s*(<)((?:.)*)(>\\s*$)",
"captures": {
"1": {
"name": "storage.type.template.cpp"
},
"2": {
"name": "punctuation.section.angle-brackets.start.template.definition.cpp"
},
"3": {
"name": "meta.template.definition.cpp",
"patterns": [
{
"include": "#template_definition_context"
}
]
},
"4": {
"name": "punctuation.section.angle-brackets.end.template.definition.cpp"
}
}
},
"template_definition": {
"name": "meta.template.definition.cpp",
"begin": "(?<!\\w)(template)\\s*(<)",
"beginCaptures": {
"1": {
"name": "storage.type.template.cpp"
},
"2": {
"name": "punctuation.section.angle-brackets.start.template.definition.cpp"
}
},
"end": "(>)",
"endCaptures": {
"1": {
"name": "punctuation.section.angle-brackets.end.template.definition.cpp"
}
},
"patterns": [
{
"begin": "((?<=\\w)\\s*<)",
"beginCaptures": {
"1": {
"name": "punctuation.section.angle-brackets.begin.template.call.cpp"
}
},
"end": "(>)",
"endCaptures": {
"1": {
"name": "punctuation.section.angle-brackets.begin.template.call.cpp"
}
},
"patterns": [
{
"include": "#template_call_context"
}
]
},
{
"include": "#template_definition_context"
}
]
},
"template_argument_defaulted": {
"match": "(?<=<|,)\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s+)*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*([=])",
"captures": {
"1": {
"name": "storage.type.template.cpp"
},
"2": {
"name": "entity.name.type.template.cpp"
},
"3": {
"name": "keyword.operator.assignment.cpp"
}
}
},
"template_definition_argument": {
"match": "(?:(?:\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s+)+)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*))|((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(\\.\\.\\.)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*))\\s*(?:(,)|(?=>|$))",
"captures": {
"1": {
"name": "storage.type.template.argument.$1.cpp"
},
"2": {
"name": "storage.type.template.argument.$2.cpp"
},
"3": {
"name": "entity.name.type.template.cpp"
},
"4": {
"name": "storage.type.template.cpp"
},
"5": {
"name": "ellipses.cpp punctuation.vararg-ellipses.template.definition.cpp"
},
"6": {
"name": "entity.name.type.template.cpp"
},
"7": {
"name": "comma.cpp punctuation.separator.template.argument.cpp"
}
}
},
"scope_resolution": {
"match": "((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*))?(::)",
"captures": {
"1": {
"patterns": [
{
"include": "#scope_resolution"
}
]
},
"2": {
"name": "entity.name.type.namespace.scope-resolution.cpp"
},
"3": {
"name": "meta.template.call.cpp",
"patterns": [
{
"include": "#template_call_context"
}
]
},
"4": {
"name": "punctuation.separator.namespace.access.cpp"
}
},
"name": "meta.scope-resolution.cpp"
},
"qualified_type": {
"match": "\\s*(?<!\\w)(?=\\w)(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)(?![\\w])\\s*)(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))\\s+)*(?:(((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?(?![\\w<:.])",
"captures": {
"0": {
"name": "entity.name.type.cpp meta.qualified_type.cpp",
"patterns": [
{
"match": "(?:class|struct|union|enum)",
"name": "storage.type.$0.cpp"
},
{
"include": "#function_type"
},
{
"include": "#storage_types"
},
{
"include": "#number_literal"
},
{
"include": "#string_context_c"
},
{
"include": "#comma"
}
]
},
"1": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"2": {
"name": "meta.scope-resolution.cpp"
},
"3": {
"patterns": [
{
"include": "#scope_resolution"
}
]
},
"4": {
"name": "entity.name.type.namespace.scope-resolution.cpp"
},
"5": {
"name": "meta.template.call.cpp",
"patterns": [
{
"include": "#template_call_context"
}
]
},
"6": {
"name": "punctuation.separator.namespace.access.cpp"
}
}
},
"type_alias": {
"match": "(using)\\s*(?!namespace)(\\s*(?<!\\w)(?=\\w)(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)(?![\\w])\\s*)(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))\\s+)*(?:(((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?(?![\\w<:.]))\\s*(\\=)\\s*(typename)?\\s*((?:(?-mix:(?:(?<!\\w)(?:const|static|volatile|register|restrict|extern)(?!\\w)))\\s+)*)(?:(\\s*(?<!\\w)(?=\\w)(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)(?![\\w])\\s*)(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))\\s+)*(?:(((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?(?![\\w<:.]))|(.+(?<!;)))(((?:\\*\\s*)*)((?:\\&\\s*?){0,2})\\s*)(?:(\\[)(\\w*)(\\])\\s*)?\\s*(?:(;)|\\n)",
"captures": {
"1": {
"name": "keyword.other.using.directive.cpp"
},
"2": {
"name": "entity.name.type.cpp meta.qualified_type.cpp",
"patterns": [
{
"match": "(?:class|struct|union|enum)",
"name": "storage.type.$0.cpp"
},
{
"include": "#function_type"
},
{
"include": "#storage_types"
},
{
"include": "#number_literal"
},
{
"include": "#string_context_c"
},
{
"include": "#comma"
}
]
},
"3": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"4": {
"name": "meta.scope-resolution.cpp"
},
"5": {
"patterns": [
{
"include": "#scope_resolution"
}
]
},
"6": {
"name": "entity.name.type.namespace.scope-resolution.cpp"
},
"7": {
"name": "meta.template.call.cpp",
"patterns": [
{
"include": "#template_call_context"
}
]
},
"8": {
"name": "punctuation.separator.namespace.access.cpp"
},
"9": {
"name": "keyword.operator.assignment.cpp"
},
"10": {
"name": "keyword.other.typename.cpp"
},
"11": {
"patterns": [
{
"include": "#storage_specifiers"
}
]
},
"12": {
"name": "entity.name.type.cpp meta.qualified_type.cpp",
"patterns": [
{
"match": "(?:class|struct|union|enum)",
"name": "storage.type.$0.cpp"
},
{
"include": "#function_type"
},
{
"include": "#storage_types"
},
{
"include": "#number_literal"
},
{
"include": "#string_context_c"
},
{
"include": "#comma"
}
]
},
"13": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"14": {
"name": "meta.scope-resolution.cpp"
},
"15": {
"patterns": [
{
"include": "#scope_resolution"
}
]
},
"16": {
"name": "entity.name.type.namespace.scope-resolution.cpp"
},
"17": {
"name": "meta.template.call.cpp",
"patterns": [
{
"include": "#template_call_context"
}
]
},
"18": {
"name": "punctuation.separator.namespace.access.cpp"
},
"19": {
"name": "meta.declaration.type.alias.value.unknown.cpp",
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"21": {
"name": "storage.modifier.pointer.cpp"
},
"22": {
"name": "storage.modifier.reference.cpp"
},
"23": {
"name": "punctuation.definition.begin.bracket.square.cpp"
},
"24": {
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"25": {
"name": "punctuation.definition.end.bracket.square.cpp"
},
"26": {
"name": "punctuation.terminator.statement.cpp"
}
},
"name": "meta.declaration.type.alias.cpp"
},
"struct_declare": {
"match": "(struct)\\s+((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))\\s*(?:(((?:\\*\\s*)*)((?:\\&\\s*?){0,2})\\s*)|\\s+)((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))",
"captures": {
"1": {
"name": "storage.type.struct.declare.cpp"
},
"2": {
"name": "entity.name.type.struct.cpp"
},
"4": {
"name": "storage.modifier.pointer.cpp"
},
"5": {
"name": "storage.modifier.reference.cpp"
},
"6": {
"name": "variable.other.object.declare.cpp"
}
}
},
"parameter_struct": {
"match": "(struct)\\s+((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))\\s*(?:(((?:\\*\\s*)*)((?:\\&\\s*?){0,2})\\s*)|\\s+)((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))?\\s*(?:\\[\\s*\\]\\s*)?(?=,|\\)|\\n)",
"captures": {
"1": {
"name": "storage.type.struct.parameter.cpp"
},
"2": {
"name": "entity.name.type.struct.parameter.cpp"
},
"4": {
"name": "storage.modifier.pointer.cpp"
},
"5": {
"name": "storage.modifier.reference.cpp"
},
"6": {
"name": "variable.other.object.declare.cpp"
}
}
},
"function_definition": {
"name": "meta.function.definition.parameters.cpp",
"begin": "(?<!\\w)(?!\\s*(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|auto|void|char|short|int|signed|unsigned|long|float|double|bool|wchar_t|u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t|NULL|true|false|nullptr|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\s*\\()(?=(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*\\()",
"end": "(?<=\\))",
"patterns": [
{
"include": "#parameter_struct"
},
{
"include": "#function_context_c"
}
]
},
"static_assert": {
"begin": "(static_assert|_Static_assert)\\s*(\\()",
"beginCaptures": {
"1": {
"name": "keyword.other.static_assert.cpp"
},
"2": {
"name": "punctuation.section.arguments.begin.bracket.round.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.arguments.end.bracket.round.cpp"
}
},
"patterns": [
{
"name": "meta.static_assert.message.cpp",
"begin": "(,)\\s*(?=(?:L|u8|u|U\\s*\\\")?)",
"beginCaptures": {
"1": {
"name": "comma.cpp punctuation.separator.delimiter.cpp"
}
},
"end": "(?=\\))",
"patterns": [
{
"include": "#string_context"
},
{
"include": "#string_context_c"
}
]
},
{
"include": "#function_call_context_c"
}
]
},
"function_call": {
"begin": "(?<!\\w)(?!\\s*(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|auto|void|char|short|int|signed|unsigned|long|float|double|bool|wchar_t|u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t|NULL|true|false|nullptr|class|struct|union|enum|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized)\\s*\\()((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*))?(\\()",
"beginCaptures": {
"1": {
"patterns": [
{
"include": "#scope_resolution"
}
]
},
"2": {
"name": "entity.name.function.call.cpp"
},
"3": {
"name": "meta.template.call.cpp",
"patterns": [
{
"include": "#template_call_context"
}
]
},
"4": {
"name": "punctuation.section.arguments.begin.bracket.round.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.arguments.end.bracket.round.cpp"
}
},
"patterns": [
{
"include": "#function_call_context_c"
}
]
},
"legacy_function_definition": {
"name": "meta.function.definition.parameters.cpp",
"begin": "(?!(?:(?:::|\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\.|\\->|\\+\\+|\\-\\-|\\+|\\-|!|not|~|compl|\\*|&|sizeof|sizeof\\.\\.\\.|new|new\\[\\]|delete|delete\\[\\]|\\.\\*|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|not_eq|&|bitand|\\^|xor|\\||bitor|&&|and|\\|\\||or|\\?:|throw|=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|and_eq|\\^=|xor_eq|\\|=|or_eq|,|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast)|(?:throw|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default))\\s*\\()((?:(?-mix:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*|::)++|(?<=operator)(?:\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|\\-\\-|\\+|\\-|!|~|\\*|&|new|new\\[\\]|delete|delete\\[\\]|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|&|\\^|\\||&&|\\|\\||=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|\\^=|\\|=|,)))\\s*(\\()",
"beginCaptures": {
"1": {
"name": "entity.name.function.cpp"
},
"2": {
"name": "punctuation.section.parameters.begin.bracket.round.cpp"
}
},
"end": "(\\)|:)",
"endCaptures": {
"1": {
"name": "punctuation.section.parameters.end.bracket.round.cpp"
}
},
"patterns": [
{
"include": "#probably_a_parameter"
},
{
"include": "#function_context_c"
}
]
},
"operators": {
"patterns": [
{
"include": "#sizeof_operator"
},
{
"include": "#alignof_operator"
},
{
"include": "#alignas_operator"
},
{
"include": "#typeid_operator"
},
{
"include": "#decltype_specifier"
},
{
"match": "(?<!\\w)(?:static_cast|dynamic_cast|const_cast|reinterpret_cast)(?!\\w)",
"name": "keyword.operator.wordlike.cpp keyword.operator.cast.$0.cpp"
},
{
"include": "#method_access"
},
{
"include": "#member_access"
},
{
"match": "(?<!\\w)(?:not|compl|new|delete|not_eq|bitand|xor|bitor|and|or|and_eq|xor_eq|or_eq|noexcept)(?!\\w)",
"name": "keyword.operator.wordlike.cpp alias.cpp keyword.operator.$0.cpp"
},
{
"include": "#vararg_ellipses"
},
{
"match": "--",
"name": "keyword.operator.decrement.cpp"
},
{
"match": "\\+\\+",
"name": "keyword.operator.increment.cpp"
},
{
"match": "%=|\\+=|-=|\\*=|(?<!\\()/=",
"name": "keyword.operator.assignment.compound.cpp"
},
{
"match": "&=|\\^=|<<=|>>=|\\|=",
"name": "keyword.operator.assignment.compound.bitwise.cpp"
},
{
"match": "<<|>>",
"name": "keyword.operator.bitwise.shift.cpp"
},
{
"match": "!=|<=|>=|==|<|>",
"name": "keyword.operator.comparison.cpp"
},
{
"match": "&&|!|\\|\\|",
"name": "keyword.operator.logical.cpp"
},
{
"match": "&|\\||\\^|~",
"name": "keyword.operator.cpp"
},
{
"include": "#assignment_operator"
},
{
"match": "%|\\*|/|-|\\+",
"name": "keyword.operator.cpp"
},
{
"begin": "\\?",
"beginCaptures": {
"0": {
"name": "keyword.operator.ternary.cpp"
}
},
"end": ":",
"applyEndPatternLast": true,
"endCaptures": {
"0": {
"name": "keyword.operator.ternary.cpp"
}
},
"patterns": [
{
"include": "#method_access"
},
{
"include": "#member_access"
},
{
"include": "#function_call_c"
},
{
"include": "$base"
}
]
}
]
},
"function_pointer": {
"begin": "(\\s*(?<!\\w)(?=\\w)(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)(?![\\w])\\s*)(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))\\s+)*(?:(((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*))?(::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?(?![\\w<:.]))\\s*(((?:\\*\\s*)*)((?:\\&\\s*?){0,2})\\s*)(\\()(\\*)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)?\\s*(?:(\\[)(\\w*)(\\])\\s*)*(\\))\\s*(\\()",
"beginCaptures": {
"1": {
"name": "entity.name.type.cpp meta.qualified_type.cpp",
"patterns": [
{
"match": "(?:class|struct|union|enum)",
"name": "storage.type.$0.cpp"
},
{
"include": "#function_type"
},
{
"include": "#storage_types"
},
{
"include": "#number_literal"
},
{
"include": "#string_context_c"
},
{
"include": "#comma"
}
]
},
"2": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"3": {
"name": "meta.scope-resolution.cpp"
},
"4": {
"patterns": [
{
"include": "#scope_resolution"
}
]
},
"5": {
"name": "entity.name.type.namespace.scope-resolution.cpp"
},
"6": {
"name": "meta.template.call.cpp",
"patterns": [
{
"include": "#template_call_context"
}
]
},
"7": {
"name": "punctuation.separator.namespace.access.cpp"
},
"9": {
"name": "storage.modifier.pointer.cpp"
},
"10": {
"name": "storage.modifier.reference.cpp"
},
"11": {
"name": "punctuation.section.parens.begin.bracket.round.function.pointer.cpp"
},
"12": {
"name": "punctuation.definition.function.pointer.dereference.cpp"
},
"13": {
"name": "variable.other.definition.pointer.function.cpp"
},
"14": {
"name": "punctuation.definition.begin.bracket.square.cpp"
},
"15": {
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"16": {
"name": "punctuation.definition.end.bracket.square.cpp"
},
"17": {
"name": "punctuation.section.parens.end.bracket.round.function.pointer.cpp"
},
"18": {
"name": "punctuation.section.parameters.begin.bracket.round.function.pointer.cpp"
}
},
"end": "(\\))\\s*(?=[{=,);]|\\n)(?!\\()",
"endCaptures": {
"1": {
"name": "punctuation.section.parameters.end.bracket.round.function.pointer.cpp"
}
},
"patterns": [
{
"include": "#parameter_struct"
},
{
"include": "#probably_a_parameter"
},
{
"include": "#function_context_c"
}
]
},
"probably_a_parameter": {
"match": "(?:((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?==))|((?<=\\w |\\*\\/|[&*>\\]\\)]|\\.\\.\\.)\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?=(?:\\[\\]\\s*)?(?:,|\\)))))",
"captures": {
"1": {
"name": "variable.parameter.defaulted.cpp"
},
"2": {
"name": "variable.parameter.cpp"
}
}
},
"operator_overload": {
"name": "meta.function.definition.parameters.operator-overload.cpp",
"begin": "(operator)((?:\\s*(?:\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|\\-\\-|\\+|\\-|!|~|\\*|&|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|&|\\^|\\||&&|\\|\\||=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|\\^=|\\|=|,)|\\s+(?:(?:new|new\\[\\]|delete|delete\\[\\])|(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:&)?)))\\s*(\\()",
"beginCaptures": {
"1": {
"name": "keyword.other.operator.overload.cpp"
},
"2": {
"name": "entity.name.operator.overloadee.cpp",
"patterns": [
{
"include": "#scope_resolution"
}
]
},
"3": {
"name": "punctuation.section.parameters.begin.bracket.round.operator-overload.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.parameters.end.bracket.round.operator-overload.cpp"
}
},
"patterns": [
{
"include": "#probably_a_parameter"
},
{
"include": "#function_context_c"
}
]
},
"member_access": {
"match": "(?:((?<!\\w)this(?!\\w))|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*|(?<=\\]|\\)))\\s*))(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!auto[^(?-mix:\\w)]|void[^(?-mix:\\w)]|char[^(?-mix:\\w)]|short[^(?-mix:\\w)]|int[^(?-mix:\\w)]|signed[^(?-mix:\\w)]|unsigned[^(?-mix:\\w)]|long[^(?-mix:\\w)]|float[^(?-mix:\\w)]|double[^(?-mix:\\w)]|bool[^(?-mix:\\w)]|wchar_t[^(?-mix:\\w)]|u_char[^(?-mix:\\w)]|u_short[^(?-mix:\\w)]|u_int[^(?-mix:\\w)]|u_long[^(?-mix:\\w)]|ushort[^(?-mix:\\w)]|uint[^(?-mix:\\w)]|u_quad_t[^(?-mix:\\w)]|quad_t[^(?-mix:\\w)]|qaddr_t[^(?-mix:\\w)]|caddr_t[^(?-mix:\\w)]|daddr_t[^(?-mix:\\w)]|div_t[^(?-mix:\\w)]|dev_t[^(?-mix:\\w)]|fixpt_t[^(?-mix:\\w)]|blkcnt_t[^(?-mix:\\w)]|blksize_t[^(?-mix:\\w)]|gid_t[^(?-mix:\\w)]|in_addr_t[^(?-mix:\\w)]|in_port_t[^(?-mix:\\w)]|ino_t[^(?-mix:\\w)]|key_t[^(?-mix:\\w)]|mode_t[^(?-mix:\\w)]|nlink_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|pid_t[^(?-mix:\\w)]|off_t[^(?-mix:\\w)]|segsz_t[^(?-mix:\\w)]|swblk_t[^(?-mix:\\w)]|uid_t[^(?-mix:\\w)]|id_t[^(?-mix:\\w)]|clock_t[^(?-mix:\\w)]|size_t[^(?-mix:\\w)]|ssize_t[^(?-mix:\\w)]|time_t[^(?-mix:\\w)]|useconds_t[^(?-mix:\\w)]|suseconds_t[^(?-mix:\\w)]|int8_t[^(?-mix:\\w)]|int16_t[^(?-mix:\\w)]|int32_t[^(?-mix:\\w)]|int64_t[^(?-mix:\\w)]|uint8_t[^(?-mix:\\w)]|uint16_t[^(?-mix:\\w)]|uint32_t[^(?-mix:\\w)]|uint64_t[^(?-mix:\\w)]|int_least8_t[^(?-mix:\\w)]|int_least16_t[^(?-mix:\\w)]|int_least32_t[^(?-mix:\\w)]|int_least64_t[^(?-mix:\\w)]|uint_least8_t[^(?-mix:\\w)]|uint_least16_t[^(?-mix:\\w)]|uint_least32_t[^(?-mix:\\w)]|uint_least64_t[^(?-mix:\\w)]|int_fast8_t[^(?-mix:\\w)]|int_fast16_t[^(?-mix:\\w)]|int_fast32_t[^(?-mix:\\w)]|int_fast64_t[^(?-mix:\\w)]|uint_fast8_t[^(?-mix:\\w)]|uint_fast16_t[^(?-mix:\\w)]|uint_fast32_t[^(?-mix:\\w)]|uint_fast64_t[^(?-mix:\\w)]|intptr_t[^(?-mix:\\w)]|uintptr_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|intmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)]|uintmax_t[^(?-mix:\\w)])(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\b(?!\\())",
"captures": {
"1": {
"name": "variable.language.this.cpp"
},
"2": {
"name": "variable.other.object.access.cpp"
},
"3": {
"name": "punctuation.separator.dot-access.cpp"
},
"4": {
"name": "punctuation.separator.pointer-access.cpp"
},
"5": {
"patterns": [
{
"match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?-mix:(?:(?:(?<!\\w)this(?!\\w))|(?:(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*|(?<=\\]|\\)))\\s*))(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->))))",
"name": "variable.other.object.property.cpp"
},
{
"match": "(?:((?<!\\w)this(?!\\w))|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*|(?<=\\]|\\)))\\s*))(?:((?:\\.\\*|\\.))|((?:->\\*|->)))",
"captures": {
"1": {
"name": "variable.language.this.cpp"
},
"2": {
"name": "variable.other.object.access.cpp"
},
"3": {
"name": "punctuation.separator.dot-access.cpp"
},
"4": {
"name": "punctuation.separator.pointer-access.cpp"
}
}
},
{
"include": "#member_access"
},
{
"include": "#method_access"
}
]
},
"6": {
"name": "variable.other.property.cpp"
}
}
},
"method_access": {
"contentName": "meta.function-call.member",
"begin": "(?:((?<!\\w)this(?!\\w))|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*|(?<=\\]|\\)))\\s*))(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)(\\()",
"beginCaptures": {
"1": {
"name": "variable.language.this.cpp"
},
"2": {
"name": "variable.other.object.access.cpp"
},
"3": {
"name": "punctuation.separator.dot-access.cpp"
},
"4": {
"name": "punctuation.separator.pointer-access.cpp"
},
"5": {
"patterns": [
{
"match": "(?<=(?:\\.\\*|\\.|->|->\\*))\\s*(?-mix:(?:(?:(?<!\\w)this(?!\\w))|(?:(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*|(?<=\\]|\\)))\\s*))(?:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->))))",
"name": "variable.other.object.property.cpp"
},
{
"match": "(?:((?<!\\w)this(?!\\w))|((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*|(?<=\\]|\\)))\\s*))(?:((?:\\.\\*|\\.))|((?:->\\*|->)))",
"captures": {
"1": {
"name": "variable.language.this.cpp"
},
"2": {
"name": "variable.other.object.access.cpp"
},
"3": {
"name": "punctuation.separator.dot-access.cpp"
},
"4": {
"name": "punctuation.separator.pointer-access.cpp"
}
}
},
{
"include": "#member_access"
},
{
"include": "#method_access"
}
]
},
"6": {
"name": "entity.name.function.member.cpp"
},
"7": {
"name": "punctuation.section.arguments.begin.bracket.round.function.member.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.section.arguments.end.bracket.round.function.member.cpp"
}
},
"patterns": [
{
"include": "#function_call_context_c"
}
]
},
"using_namespace": {
"name": "meta.using-namespace.cpp",
"begin": "(?<!\\w)(using)\\s+(namespace)\\s+(?:((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*))?((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))(?=;|\\n)",
"beginCaptures": {
"1": {
"name": "keyword.other.using.directive.cpp"
},
"2": {
"name": "keyword.other.namespace.directive.cpp storage.type.namespace.directive.cpp"
},
"3": {
"patterns": [
{
"include": "#scope_resolution"
}
]
},
"4": {
"name": "entity.name.type.namespace.cpp"
}
},
"end": "(;)",
"endCaptures": {
"1": {
"name": "punctuation.terminator.statement.cpp"
}
}
},
"namespace_block": {
"name": "meta.block.namespace.cpp",
"begin": "((?<!\\w)(namespace)(?:(?:\\s+|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?=\\{|\\n))(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)\\s*(?:(?:((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))|(?=\\{))|\\n))",
"beginCaptures": {
"1": {
"name": "meta.head.namespace.cpp"
},
"2": {
"name": "keyword.other.namespace.definition.cpp storage.type.namespace.definition.cpp"
},
"3": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"4": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"5": {
"patterns": [
{
"include": "#scope_resolution"
}
]
},
"6": {
"name": "entity.name.type.namespace.cpp"
}
},
"end": "(?:(?<=\\})|(?=[;>\\[\\]=]))",
"patterns": [
{
"name": "meta.head.namespace.cpp",
"begin": "\\G ?",
"end": "((?:\\{|(?=;)))",
"endCaptures": {
"1": {
"name": "punctuation.section.block.begin.bracket.curly.namespace.cpp"
}
}
},
{
"name": "meta.body.namespace.cpp",
"begin": "(?<=\\{)",
"end": "(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.block.end.bracket.curly.namespace.cpp"
}
},
"patterns": [
{
"include": "$base"
}
]
},
{
"name": "meta.tail.namespace.cpp",
"begin": "(?<=})[\\s\\n]*",
"end": "[\\s\\n]*(?=;)",
"patterns": [
{
"include": "$base"
}
]
}
]
},
"macro_argument": {
"match": "##(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)",
"name": "variable.other.macro.argument.cpp"
},
"lambdas": {
"begin": "((?:(?<=[^\\s]|^)(?<![\\w\\]\\)\\[\\*])|(?<=\\Wreturn|^return))\\s*(\\[(?!\\[))((?:.*\\[.*?\\].*?)*.*?)(\\]))",
"beginCaptures": {
"2": {
"name": "punctuation.definition.capture.begin.lambda.cpp"
},
"3": {
"name": "meta.lambda.capture.cpp",
"patterns": [
{
"include": "#probably_a_parameter"
},
{
"include": "#function_context_c"
}
]
},
"4": {
"name": "punctuation.definition.capture.end.lambda.cpp"
}
},
"end": "(?<=})",
"patterns": [
{
"name": "meta.function.definition.parameters.lambda.cpp",
"begin": "(\\()",
"beginCaptures": {
"1": {
"name": "punctuation.definition.parameters.begin.lambda.cpp"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.definition.parameters.end.lambda.cpp"
}
},
"patterns": [
{
"include": "#probably_a_parameter"
},
{
"include": "#function_context_c"
}
]
},
{
"match": "(?<!\\w)(?:mutable|constexpr|consteval)(?!\\w)",
"name": "storage.modifier.lambda.$0.cpp"
},
{
"match": "(->)(.+?(?=\\{|$))?",
"captures": {
"1": {
"name": "punctuation.definition.lambda.return-type.cpp"
},
"2": {
"name": "storage.type.return-type.lambda.cpp"
}
}
},
{
"name": "meta.function.definition.body.lambda.cpp",
"begin": "(\\{)",
"beginCaptures": {
"1": {
"name": "punctuation.section.block.begin.bracket.curly.lambda.cpp"
}
},
"end": "(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.block.end.bracket.curly.lambda.cpp"
}
},
"patterns": [
{
"include": "$base"
}
]
}
]
},
"pthread_types": {
"match": "(?<!\\w)pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t(?!\\w)",
"name": "support.type.posix-reserved.pthread.cpp"
},
"posix_reserved_types": {
"match": "(?<!\\w)[a-zA-Z_](?:\\w)*_t(?!\\w)",
"name": "support.type.posix-reserved.cpp"
},
"enumerator_list": {
"match": "((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))\\s*(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*(?:(\\=)\\s*(.+?)\\s*)?(?:(?:((?:[,;]|\\n))|(?=\\}))|(?=(?:\\/\\/|\\/\\*)))",
"captures": {
"1": {
"name": "variable.other.enummember.cpp"
},
"2": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"3": {
"name": "keyword.operator.assignment.cpp"
},
"4": {
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"5": {
"patterns": [
{
"include": "#comma"
},
{
"include": "#semicolon"
}
]
}
},
"name": "meta.enum.definition.cpp"
},
"enum_block": {
"name": "meta.block.enum.cpp",
"begin": "(((?<!\\w)enum(?!\\w))(?:\\s+(class|struct))?(?:(?:\\s+|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))\\s*((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))?(?:\\s*(:)\\s*(?:(((?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)((?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:((?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*))?(::)))?\\s*((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w)))?)",
"beginCaptures": {
"1": {
"name": "meta.head.enum.cpp"
},
"2": {
"name": "storage.type.enum.cpp"
},
"3": {
"name": "storage.type.enum.enum-key.$3.cpp"
},
"4": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"5": {
"name": "entity.name.type.enum.cpp"
},
"6": {
"name": "colon.cpp punctuation.separator.type-specifier.cpp"
},
"7": {
"name": "meta.scope-resolution.cpp"
},
"8": {
"patterns": [
{
"include": "#scope_resolution"
}
]
},
"9": {
"name": "entity.name.type.namespace.scope-resolution.cpp"
},
"10": {
"name": "meta.template.call.cpp",
"patterns": [
{
"include": "#template_call_context"
}
]
},
"11": {
"name": "punctuation.separator.namespace.access.cpp"
},
"12": {
"name": "storage.type.integral.$12.cpp"
}
},
"end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))",
"endCaptures": {
"1": {
"name": "punctuation.terminator.statement.cpp"
},
"2": {
"name": "punctuation.terminator.statement.cpp"
}
},
"patterns": [
{
"name": "meta.head.enum.cpp",
"begin": "\\G ?",
"end": "((?:\\{|(?=;)))",
"endCaptures": {
"1": {
"name": "punctuation.section.block.begin.bracket.curly.enum.cpp"
}
},
"patterns": [
{
"include": "$base"
}
]
},
{
"name": "meta.body.enum.cpp",
"begin": "(?<=\\{)",
"end": "(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.block.end.bracket.curly.enum.cpp"
}
},
"patterns": [
{
"include": "#enumerator_list"
},
{
"include": "#comments_context"
},
{
"include": "#comma"
},
{
"include": "#semicolon"
}
]
},
{
"name": "meta.tail.enum.cpp",
"begin": "(?<=})[\\s\\n]*",
"end": "[\\s\\n]*(?=;)",
"patterns": [
{
"include": "$base"
}
]
}
]
},
"inhertance_context": {
"patterns": [
{
"match": ",",
"name": "comma.cpp punctuation.separator.delimiter.inhertance.cpp"
},
{
"match": "(?<!\\w)(?:private|protected|public)(?!\\w)",
"name": "storage.type.modifier.access.$0.cpp"
},
{
"match": "(?<!\\w)virtual(?!\\w)",
"name": "storage.type.modifier.virtual.cpp"
},
{
"match": "(?<=virtual|private|protected|public|,|:)\\s*(?!(?:(?:private|protected|public)|virtual))((?-mix:(?:\\s*(?<!\\w)(?=\\w)(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)(?![\\w])\\s*)(?:(?:(?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))\\s+)*(?:(?:(?:(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?(?![\\w<:.]))))",
"captures": {
"1": {
"name": "entity.name.type.inherited.cpp"
}
}
}
]
},
"class_block": {
"name": "meta.block.class.cpp",
"begin": "((((?<!\\w)class(?!\\w))(?:(?:\\s+|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))?(?:\\s+(final)\\s*)?(?:\\s*(:)((?:\\s*(?:,)?\\s*(?:(?:private|protected|public))?\\s*(?:\\s*(?:,)?\\s*(?!(?:private|protected|public))(?-mix:(?:\\s*(?<!\\w)(?=\\w)(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)(?![\\w])\\s*)(?:(?:(?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))\\s+)*(?:(?:(?:(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?(?![\\w<:.]))))+)*))?))",
"beginCaptures": {
"1": {
"name": "meta.head.class.cpp"
},
"3": {
"name": "storage.type.$3.cpp"
},
"4": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"5": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"6": {
"name": "entity.name.type.$3.cpp"
},
"7": {
"name": "storage.type.modifier.final.cpp"
},
"8": {
"name": "colon.cpp punctuation.separator.inhertance.cpp"
},
"9": {
"patterns": [
{
"include": "#inhertance_context"
}
]
}
},
"end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))",
"endCaptures": {
"1": {
"name": "punctuation.terminator.statement.cpp"
},
"2": {
"name": "punctuation.terminator.statement.cpp"
}
},
"patterns": [
{
"name": "meta.head.class.cpp",
"begin": "\\G ?",
"end": "((?:\\{|(?=;)))",
"endCaptures": {
"1": {
"name": "punctuation.section.block.begin.bracket.curly.class.cpp"
}
},
"patterns": [
{
"include": "#preprocessor_context"
},
{
"include": "#inhertance_context"
},
{
"include": "#template_call_range"
},
{
"include": "#comments_context"
}
]
},
{
"name": "meta.body.class.cpp",
"begin": "(?<=\\{)",
"end": "(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.block.end.bracket.curly.class.cpp"
}
},
"patterns": [
{
"include": "#function_pointer"
},
{
"include": "#constructor_context"
},
{
"include": "$base"
}
]
},
{
"name": "meta.tail.class.cpp",
"begin": "(?<=})[\\s\\n]*",
"end": "[\\s\\n]*(?=;)",
"patterns": [
{
"include": "$base"
}
]
}
]
},
"struct_block": {
"name": "meta.block.struct.cpp",
"begin": "((((?<!\\w)struct(?!\\w))(?:(?:\\s+|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))?(?:\\s+(final)\\s*)?(?:\\s*(:)((?:\\s*(?:,)?\\s*(?:(?:private|protected|public))?\\s*(?:\\s*(?:,)?\\s*(?!(?:private|protected|public))(?-mix:(?:\\s*(?<!\\w)(?=\\w)(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)(?![\\w])\\s*)(?:(?:(?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))\\s+)*(?:(?:(?:(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?(?![\\w<:.]))))+)*))?))",
"beginCaptures": {
"1": {
"name": "meta.head.struct.cpp"
},
"3": {
"name": "storage.type.$3.cpp"
},
"4": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"5": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"6": {
"name": "entity.name.type.$3.cpp"
},
"7": {
"name": "storage.type.modifier.final.cpp"
},
"8": {
"name": "colon.cpp punctuation.separator.inhertance.cpp"
},
"9": {
"patterns": [
{
"include": "#inhertance_context"
}
]
}
},
"end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))",
"endCaptures": {
"1": {
"name": "punctuation.terminator.statement.cpp"
},
"2": {
"name": "punctuation.terminator.statement.cpp"
}
},
"patterns": [
{
"name": "meta.head.struct.cpp",
"begin": "\\G ?",
"end": "((?:\\{|(?=;)))",
"endCaptures": {
"1": {
"name": "punctuation.section.block.begin.bracket.curly.struct.cpp"
}
},
"patterns": [
{
"include": "#preprocessor_context"
},
{
"include": "#inhertance_context"
},
{
"include": "#template_call_range"
},
{
"include": "#comments_context"
}
]
},
{
"name": "meta.body.struct.cpp",
"begin": "(?<=\\{)",
"end": "(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.block.end.bracket.curly.struct.cpp"
}
},
"patterns": [
{
"include": "#function_pointer"
},
{
"include": "#constructor_context"
},
{
"include": "$base"
}
]
},
{
"name": "meta.tail.struct.cpp",
"begin": "(?<=})[\\s\\n]*",
"end": "[\\s\\n]*(?=;)",
"patterns": [
{
"include": "$base"
}
]
}
]
},
"union_block": {
"name": "meta.block.union.cpp",
"begin": "((((?<!\\w)union(?!\\w))(?:(?:\\s+|((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))|(?={))(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))?(?:\\s+(final)\\s*)?(?:\\s*(:)((?:\\s*(?:,)?\\s*(?:(?:private|protected|public))?\\s*(?:\\s*(?:,)?\\s*(?!(?:private|protected|public))(?-mix:(?:\\s*(?<!\\w)(?=\\w)(?!(?:not|compl|sizeof|new|delete|not_eq|bitand|xor|bitor|and|or|throw|and_eq|xor_eq|or_eq|alignof|alignas|typeid|noexcept|static_cast|dynamic_cast|const_cast|reinterpret_cast|while|for|do|if|else|goto|switch|try|catch|return|break|case|continue|default|NULL|true|false|nullptr|const|static|volatile|register|restrict|extern|inline|constexpr|mutable|friend|explicit|virtual|final|override|volatile|const|noexcept|constexpr|mutable|constexpr|consteval|private|protected|public|if|elif|else|endif|ifdef|ifndef|define|undef|include|line|error|warning|pragma|_Pragma|defined|__has_include|__has_cpp_attribute|this|template|namespace|using|operator|typedef|decltype|typename|asm|__asm__|concept|requires|export|thread_local|atomic_cancel|atomic_commit|atomic_noexcept|co_await|co_return|co_yield|import|module|reflexpr|synchronized|audit|axiom|transaction_safe|transaction_safe_dynamic)(?![\\w])\\s*)(?:(?:(?:(?:(?:\\[\\[.*?\\]\\]|__attribute\\(\\(.*?\\)\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\))))?\\s*(?:(?:(?:short|signed|unsigned|long)|(?:class|struct|union|enum))\\s+)*(?:(?:(?:(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*\\s*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?::)*\\s*)(?:(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*)\\s*(?:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*))?(?:::)))?\\s*(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?(?![\\w<:.]))))+)*))?))",
"beginCaptures": {
"1": {
"name": "meta.head.union.cpp"
},
"3": {
"name": "storage.type.$3.cpp"
},
"4": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"5": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"6": {
"name": "entity.name.type.$3.cpp"
},
"7": {
"name": "storage.type.modifier.final.cpp"
},
"8": {
"name": "colon.cpp punctuation.separator.inhertance.cpp"
},
"9": {
"patterns": [
{
"include": "#inhertance_context"
}
]
}
},
"end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))",
"endCaptures": {
"1": {
"name": "punctuation.terminator.statement.cpp"
},
"2": {
"name": "punctuation.terminator.statement.cpp"
}
},
"patterns": [
{
"name": "meta.head.union.cpp",
"begin": "\\G ?",
"end": "((?:\\{|(?=;)))",
"endCaptures": {
"1": {
"name": "punctuation.section.block.begin.bracket.curly.union.cpp"
}
},
"patterns": [
{
"include": "#preprocessor_context"
},
{
"include": "#inhertance_context"
},
{
"include": "#template_call_range"
},
{
"include": "#comments_context"
}
]
},
{
"name": "meta.body.union.cpp",
"begin": "(?<=\\{)",
"end": "(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.block.end.bracket.curly.union.cpp"
}
},
"patterns": [
{
"include": "#function_pointer"
},
{
"include": "#constructor_context"
},
{
"include": "$base"
}
]
},
{
"name": "meta.tail.union.cpp",
"begin": "(?<=})[\\s\\n]*",
"end": "[\\s\\n]*(?=;)",
"patterns": [
{
"include": "$base"
}
]
}
]
},
"extern_block": {
"name": "meta.block.extern.cpp",
"begin": "((\\bextern)(?=\\s*\\\"))",
"beginCaptures": {
"1": {
"name": "meta.head.extern.cpp"
},
"2": {
"name": "storage.type.extern.cpp"
}
},
"end": "(?:(?:(?<=})\\s*(;)|(;))|(?=[;>\\[\\]=]))",
"endCaptures": {
"1": {
"name": "punctuation.terminator.statement.cpp"
},
"2": {
"name": "punctuation.terminator.statement.cpp"
}
},
"patterns": [
{
"name": "meta.head.extern.cpp",
"begin": "\\G ?",
"end": "((?:\\{|(?=;)))",
"endCaptures": {
"1": {
"name": "punctuation.section.block.begin.bracket.curly.extern.cpp"
}
},
"patterns": [
{
"include": "$base"
}
]
},
{
"name": "meta.body.extern.cpp",
"begin": "(?<=\\{)",
"end": "(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.block.end.bracket.curly.extern.cpp"
}
},
"patterns": [
{
"include": "$base"
}
]
},
{
"name": "meta.tail.extern.cpp",
"begin": "(?<=})[\\s\\n]*",
"end": "[\\s\\n]*(?=;)",
"patterns": [
{
"include": "$base"
}
]
},
{
"include": "$base"
}
]
},
"hacky_fix_for_stray_directive": {
"match": "(?<!\\w)#(?:endif|else|elif)(?!\\w)",
"name": "keyword.control.directive.$0.cpp"
},
"square_brackets": {
"name": "meta.bracket.square.access.cpp",
"begin": "([a-zA-Z_][a-zA-Z_0-9]*|(?<=[\\]\\)]))?(\\[)(?!\\])",
"beginCaptures": {
"1": {
"name": "variable.other.object.cpp"
},
"2": {
"name": "punctuation.definition.begin.bracket.square.cpp"
}
},
"end": "\\]",
"endCaptures": {
"0": {
"name": "punctuation.definition.end.bracket.square.cpp"
}
},
"patterns": [
{
"include": "#function_call_context_c"
}
]
},
"empty_square_brackets": {
"name": "storage.modifier.array.bracket.square.cpp",
"match": "(?-mix:(?-mix:(?<!delete))\\\\[\\\\s*\\\\])"
},
"assembly": {
"match": "(?<!\\w)(asm|__asm__)(?!\\w)",
"name": "storage.type.$0.cpp"
},
"misc_storage_modifiers_1": {
"match": "(?-mix:\\b(constexpr|export|mutable|typename|thread_local)\\b)",
"name": "storage.modifier.cpp"
},
"misc_storage_modifiers_2": {
"match": "(?-mix:\\b(const|extern|register|restrict|static|volatile|inline)\\b)",
"name": "storage.modifier.cpp"
},
"destructor": {
"name": "meta.function.destructor.cpp",
"begin": "(?x)\n(?:\n ^ | # beginning of line\n (?:(?<!else|new|=)) # or word + space before name\n)\n((?:[A-Za-z_][A-Za-z0-9_]*::)*+~[A-Za-z_][A-Za-z0-9_]*) # actual name\n\\s*(\\() # opening bracket",
"beginCaptures": {
"1": {
"name": "entity.name.function.destructor.cpp"
},
"2": {
"name": "punctuation.definition.parameters.begin.destructor.cpp"
}
},
"end": "(?-mix:\\))",
"endCaptures": {
"0": {
"name": "punctuation.definition.parameters.end.destructor.cpp"
}
},
"patterns": [
{
"include": "$base"
}
]
},
"destructor_prototype": {
"name": "meta.function.destructor.prototype.cpp",
"begin": "(?x)\n(?:\n ^ | # beginning of line\n (?:(?<!else|new|=)) # or word + space before name\n)\n((?:[A-Za-z_][A-Za-z0-9_]*::)*+~[A-Za-z_][A-Za-z0-9_]*) # actual name\n\\s*(\\() # opening bracket",
"beginCaptures": {
"1": {
"name": "entity.name.function.cpp"
},
"2": {
"name": "punctuation.definition.parameters.begin.cpp"
}
},
"end": "(?-mix:\\))",
"endCaptures": {
"0": {
"name": "punctuation.definition.parameters.end.cpp"
}
},
"patterns": [
{
"include": "$base"
}
]
},
"meta_preprocessor_macro": {
"name": "meta.preprocessor.macro.cpp",
"begin": "(?x)\n^\\s* ((\\#)\\s*define) \\s+\t# define\n((?<id>(?-mix:[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)?",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.define.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
},
"3": {
"name": "entity.name.function.preprocessor.cpp"
},
"5": {
"name": "punctuation.definition.parameters.begin.cpp"
},
"6": {
"name": "variable.parameter.preprocessor.cpp"
},
"8": {
"name": "punctuation.separator.parameters.cpp"
},
"9": {
"name": "punctuation.definition.parameters.end.cpp"
}
},
"end": "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)",
"patterns": [
{
"include": "#preprocessor_rule_define_line_context"
}
]
},
"meta_preprocessor_diagnostic": {
"name": "meta.preprocessor.diagnostic.cpp",
"begin": "^\\s*((#)\\s*(error|warning))\\b\\s*",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.diagnostic.$3.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?<!\\\\)(?=\\n)",
"patterns": [
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
}
},
"end": "\"|(?<!\\\\)(?=\\s*\\n)",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
}
},
"name": "string.quoted.double.cpp",
"patterns": [
{
"include": "#line_continuation_character"
}
]
},
{
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
}
},
"end": "'|(?<!\\\\)(?=\\s*\\n)",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
}
},
"name": "string.quoted.single.cpp",
"patterns": [
{
"include": "#line_continuation_character"
}
]
},
{
"begin": "[^'\"]",
"end": "(?<!\\\\)(?=\\s*\\n)",
"name": "string.unquoted.single.cpp",
"patterns": [
{
"include": "#line_continuation_character"
},
{
"include": "#comments_context"
}
]
}
]
},
"meta_preprocessor_include": {
"name": "meta.preprocessor.include.cpp",
"begin": "^\\s*((#)\\s*(include(?:_next)?|import))\\b\\s*",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.$3.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)",
"patterns": [
{
"include": "#line_continuation_character"
},
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
}
},
"name": "string.quoted.double.include.cpp"
},
{
"begin": "<",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
}
},
"end": ">",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
}
},
"name": "string.quoted.other.lt-gt.include.cpp"
}
]
},
"meta_preprocessor_line": {
"name": "meta.preprocessor.cpp",
"begin": "^\\s*((#)\\s*line)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.line.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)",
"patterns": [
{
"include": "#string_context_c"
},
{
"include": "#number_literal"
},
{
"include": "#line_continuation_character"
}
]
},
"meta_preprocessor_undef": {
"name": "meta.preprocessor.cpp",
"begin": "^\\s*(?:((#)\\s*undef))\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.undef.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)",
"patterns": [
{
"match": "(?-mix:[a-zA-Z_$][\\w$]*)",
"name": "entity.name.function.preprocessor.cpp"
},
{
"include": "#line_continuation_character"
}
]
},
"meta_preprocessor_pragma": {
"name": "meta.preprocessor.pragma.cpp",
"begin": "^\\s*(?:((#)\\s*pragma))\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.pragma.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)",
"patterns": [
{
"include": "#string_context_c"
},
{
"match": "[a-zA-Z_$][\\w\\-$]*",
"name": "entity.other.attribute-name.pragma.preprocessor.cpp"
},
{
"include": "#number_literal"
},
{
"include": "#line_continuation_character"
}
]
},
"constructor_context": {
"patterns": [
{
"begin": "(?x)\n(?:^\\s*) # beginning of line\n((?!while|for|do|if|else|switch|catch)[A-Za-z_][A-Za-z0-9_:]*) # actual name\n\\s*(\\() # opening bracket",
"beginCaptures": {
"1": {
"name": "entity.name.function.constructor.cpp"
},
"2": {
"name": "punctuation.definition.parameters.begin.constructor.cpp"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.definition.parameters.end.constructor.cpp"
}
},
"name": "meta.function.constructor.cpp",
"patterns": [
{
"include": "#probably_a_parameter"
},
{
"include": "#function_context_c"
}
]
},
{
"begin": "(?x)\n(:)\n(\n (?=\n \\s*[A-Za-z_][A-Za-z0-9_:]* # actual name\n \\s* (\\() # opening bracket\n )\n)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.initializer-list.parameters.cpp"
}
},
"end": "(?=\\{)",
"name": "meta.function.constructor.initializer-list.cpp",
"patterns": [
{
"include": "$base"
}
]
}
]
},
"special_block_context": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#using_namespace"
},
{
"include": "#type_alias"
},
{
"include": "#namespace_block"
},
{
"include": "#class_block"
},
{
"include": "#struct_block"
},
{
"include": "#union_block"
},
{
"include": "#enum_block"
},
{
"include": "#extern_block"
}
]
},
"string_context": {
"patterns": [
{
"begin": "(u|u8|U|L)?\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
},
"1": {
"name": "meta.encoding.cpp"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
}
},
"name": "string.quoted.double.cpp",
"patterns": [
{
"match": "\\\\u\\h{4}|\\\\U\\h{8}",
"name": "constant.character.escape.cpp"
},
{
"match": "\\\\['\"?\\\\abfnrtv]",
"name": "constant.character.escape.cpp"
},
{
"match": "\\\\[0-7]{1,3}",
"name": "constant.character.escape.cpp"
},
{
"match": "\\\\x\\h+",
"name": "constant.character.escape.cpp"
},
{
"include": "#string_escapes_context_c"
}
]
},
{
"begin": "(u|u8|U|L)?R\"(?:([^ ()\\\\\\t]{0,16})|([^ ()\\\\\\t]*))\\(",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
},
"1": {
"name": "meta.encoding.cpp"
},
"3": {
"name": "invalid.illegal.delimiter-too-long.cpp"
}
},
"end": "\\)\\2(\\3)\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
},
"1": {
"name": "invalid.illegal.delimiter-too-long.cpp"
}
},
"name": "string.quoted.double.raw.cpp"
}
]
},
"block": {
"begin": "{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.bracket.curly.cpp"
}
},
"end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.bracket.curly.cpp"
}
},
"name": "meta.block.cpp",
"patterns": [
{
"include": "#block_context"
}
]
},
"block_context": {
"patterns": [
{
"include": "#preprocessor_rule_enabled_block"
},
{
"include": "#preprocessor_rule_disabled_block"
},
{
"include": "#preprocessor_rule_conditional_block"
},
{
"include": "#method_access"
},
{
"include": "#member_access"
},
{
"include": "#function_call_c"
},
{
"name": "meta.initialization.cpp",
"begin": "(?x)\n(?:\n (?:\n\t(?=\\s)(?<!else|new|return)\n\t(?<=\\w) \\s+(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas) # or word + space before name\n )\n)\n(\n (?:[A-Za-z_][A-Za-z0-9_]*+ | :: )++ # actual name\n |\n (?:(?<=operator) (?:[-*&<>=+!]+ | \\(\\) | \\[\\]))\n)\n\\s*(\\() # opening bracket",
"beginCaptures": {
"1": {
"name": "variable.other.cpp"
},
"2": {
"name": "punctuation.section.parens.begin.bracket.round.initialization.cpp"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.parens.end.bracket.round.initialization.cpp"
}
},
"patterns": [
{
"include": "#function_call_context_c"
}
]
},
{
"begin": "{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.bracket.curly.cpp"
}
},
"end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.bracket.curly.cpp"
}
},
"patterns": [
{
"include": "#block_context"
}
]
},
{
"include": "#parentheses_block"
},
{
"include": "$base"
}
]
},
"function_call_c": {
"begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|return|typeid|alignof|alignas|sizeof|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas|constexpr|volatile|operator|(?:::)?new|(?:::)?delete)\\s*\\()\n(?=\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*(?-mix:(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?)\\( # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)",
"end": "(?<=\\))(?!\\w)",
"name": "meta.function-call.cpp",
"patterns": [
{
"include": "#function_call_context_c"
}
]
},
"comments_context": {
"patterns": [
{
"captures": {
"1": {
"name": "meta.toc-list.banner.block.cpp"
}
},
"match": "^/\\* =(\\s*.*?)\\s*= \\*/$\\n?",
"name": "comment.block.cpp"
},
{
"begin": "/\\*",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.begin.cpp"
}
},
"end": "\\*/",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.cpp"
}
},
"name": "comment.block.cpp"
},
{
"captures": {
"1": {
"name": "meta.toc-list.banner.line.cpp"
}
},
"match": "^// =(\\s*.*?)\\s*=\\s*$\\n?",
"name": "comment.line.banner.cpp"
},
{
"begin": "(^[ \\t]+)?(?=//)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.cpp"
}
},
"end": "(?!\\G)",
"patterns": [
{
"begin": "//",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.cpp"
}
},
"end": "(?=\\n)",
"name": "comment.line.double-slash.cpp",
"patterns": [
{
"include": "#line_continuation_character"
}
]
}
]
}
]
},
"disabled": {
"begin": "^\\s*#\\s*if(n?def)?\\b.*$",
"end": "^\\s*#\\s*endif\\b",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
},
"line_continuation_character": {
"match": "(\\\\)\\n",
"captures": {
"1": {
"name": "constant.character.escape.line-continuation.cpp"
}
}
},
"parentheses": {
"name": "meta.parens.cpp",
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.parens.begin.bracket.round.cpp"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.parens.end.bracket.round.cpp"
}
},
"patterns": [
{
"include": "$base"
}
]
},
"parentheses_block": {
"name": "meta.parens.block.cpp",
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.parens.begin.bracket.round.cpp"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.parens.end.bracket.round.cpp"
}
},
"patterns": [
{
"include": "#block_context"
},
{
"match": "(?-mix:(?<!:):(?!:))",
"name": "colon.cpp punctuation.separator.range-based.cpp"
}
]
},
"pragma_mark": {
"captures": {
"1": {
"name": "meta.preprocessor.pragma.cpp"
},
"2": {
"name": "keyword.control.directive.pragma.pragma-mark.cpp"
},
"3": {
"name": "punctuation.definition.directive.cpp"
},
"4": {
"name": "entity.name.tag.pragma-mark.cpp"
}
},
"match": "^\\s*(((#)\\s*pragma\\s+mark)\\s+(.*))",
"name": "meta.section.cpp"
},
"string_context_c": {
"patterns": [
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
}
},
"name": "string.quoted.double.cpp",
"patterns": [
{
"include": "#string_escapes_context_c"
},
{
"include": "#line_continuation_character"
}
]
},
{
"begin": "(?-mix:(?<![\\da-fA-F])')",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
}
},
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
}
},
"name": "string.quoted.single.cpp",
"patterns": [
{
"include": "#string_escapes_context_c"
},
{
"include": "#line_continuation_character"
}
]
}
]
},
"string_escapes_context_c": {
"patterns": [
{
"match": "(?x)\\\\ (\n\\\\\t\t\t |\n[abefnprtv'\"?] |\n[0-3]\\d{,2}\t |\n[4-7]\\d?\t\t|\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )",
"name": "constant.character.escape.cpp"
},
{
"match": "\\\\.",
"name": "invalid.illegal.unknown-escape.cpp"
},
{
"match": "(?x) %\n(\\d+\\$)?\t\t\t\t\t\t # field (argument #)\n[#0\\- +']*\t\t\t\t\t\t # flags\n[,;:_]?\t\t\t\t\t\t\t # separator character (AltiVec)\n((-?\\d+)|\\*(-?\\d+\\$)?)?\t\t # minimum field width\n(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)?\t# precision\n(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier\n[diouxXDOUeEfFgGaACcSspn%]\t\t # conversion type",
"name": "constant.other.placeholder.cpp"
}
]
},
"vararg_ellipses": {
"match": "(?<!\\.)\\.\\.\\.(?!\\.)",
"name": "punctuation.vararg-ellipses.cpp"
},
"preprocessor_rule_conditional": {
"begin": "^\\s*((#)\\s*if(?:n?def)?\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "^\\s*((#)\\s*endif\\b)",
"endCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"patterns": [
{
"begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#preprocessor_rule_enabled_elif"
},
{
"include": "#preprocessor_rule_enabled_else"
},
{
"include": "#preprocessor_rule_disabled_elif"
},
{
"begin": "^\\s*((#)\\s*elif\\b)",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "$base"
}
]
},
"preprocessor_rule_conditional_block": {
"begin": "^\\s*((#)\\s*if(?:n?def)?\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "^\\s*((#)\\s*endif\\b)",
"endCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"patterns": [
{
"begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#preprocessor_rule_enabled_elif_block"
},
{
"include": "#preprocessor_rule_enabled_else_block"
},
{
"include": "#preprocessor_rule_disabled_elif"
},
{
"begin": "^\\s*((#)\\s*elif\\b)",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#block_context"
}
]
},
"preprocessor_rule_conditional_line_context": {
"patterns": [
{
"match": "(?:\\bdefined\\b\\s*$)|(?:\\bdefined\\b(?=\\s*\\(*\\s*(?:(?!defined\\b)[a-zA-Z_$][\\w$]*\\b)\\s*\\)*\\s*(?:\\n|//|/\\*|\\?|\\:|&&|\\|\\||\\\\\\s*\\n)))",
"name": "keyword.control.directive.conditional.cpp"
},
{
"match": "\\bdefined\\b",
"name": "invalid.illegal.macro-name.cpp"
},
{
"include": "#comments_context"
},
{
"include": "#string_context_c"
},
{
"include": "#number_literal"
},
{
"begin": "\\?",
"beginCaptures": {
"0": {
"name": "keyword.operator.ternary.cpp"
}
},
"end": ":",
"endCaptures": {
"0": {
"name": "keyword.operator.ternary.cpp"
}
},
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#operators"
},
{
"include": "#language_constants"
},
{
"match": "(?-mix:[a-zA-Z_$][\\w$]*)",
"name": "entity.name.function.preprocessor.cpp"
},
{
"include": "#line_continuation_character"
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.parens.begin.bracket.round.cpp"
}
},
"end": "\\)|(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"endCaptures": {
"0": {
"name": "punctuation.section.parens.end.bracket.round.cpp"
}
},
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
}
]
},
"preprocessor_rule_disabled": {
"begin": "^\\s*((#)\\s*if\\b)(?=\\s*\\(*\\b0+\\b\\)*\\s*(?:$|//|/\\*))",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "^\\s*((#)\\s*endif\\b)",
"endCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"patterns": [
{
"begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#comments_context"
},
{
"include": "#preprocessor_rule_enabled_elif"
},
{
"include": "#preprocessor_rule_enabled_else"
},
{
"include": "#preprocessor_rule_disabled_elif"
},
{
"begin": "^\\s*((#)\\s*elif\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*(?:elif|else|endif)\\b))",
"patterns": [
{
"begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "$base"
}
]
},
{
"contentName": "comment.block.preprocessor.if-branch",
"begin": "\\n",
"end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
}
]
},
"preprocessor_rule_disabled_block": {
"begin": "^\\s*((#)\\s*if\\b)(?=\\s*\\(*\\b0+\\b\\)*\\s*(?:$|//|/\\*))",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "^\\s*((#)\\s*endif\\b)",
"endCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"patterns": [
{
"begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#comments_context"
},
{
"include": "#preprocessor_rule_enabled_elif_block"
},
{
"include": "#preprocessor_rule_enabled_else_block"
},
{
"include": "#preprocessor_rule_disabled_elif"
},
{
"begin": "^\\s*((#)\\s*elif\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*(?:elif|else|endif)\\b))",
"patterns": [
{
"begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#block_context"
}
]
},
{
"contentName": "comment.block.preprocessor.if-branch.in-block",
"begin": "\\n",
"end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
}
]
},
"preprocessor_rule_disabled_elif": {
"begin": "^\\s*((#)\\s*elif\\b)(?=\\s*\\(*\\b0+\\b\\)*\\s*(?:$|//|/\\*))",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*(?:elif|else|endif)\\b))",
"patterns": [
{
"begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#comments_context"
},
{
"contentName": "comment.block.preprocessor.elif-branch",
"begin": "\\n",
"end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
}
]
},
"preprocessor_rule_enabled": {
"begin": "^\\s*((#)\\s*if\\b)(?=\\s*\\(*\\b0*1\\b\\)*\\s*(?:$|//|/\\*))",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
},
"3": {
"name": "constant.numeric.preprocessor.cpp"
}
},
"end": "^\\s*((#)\\s*endif\\b)",
"endCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"patterns": [
{
"begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#comments_context"
},
{
"contentName": "comment.block.preprocessor.else-branch",
"begin": "^\\s*((#)\\s*else\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*endif\\b))",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
},
{
"contentName": "comment.block.preprocessor.if-branch",
"begin": "^\\s*((#)\\s*elif\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
},
{
"begin": "\\n",
"end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))",
"patterns": [
{
"include": "$base"
}
]
}
]
},
"preprocessor_rule_enabled_block": {
"begin": "^\\s*((#)\\s*if\\b)(?=\\s*\\(*\\b0*1\\b\\)*\\s*(?:$|//|/\\*))",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "^\\s*((#)\\s*endif\\b)",
"endCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"patterns": [
{
"begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#comments_context"
},
{
"contentName": "comment.block.preprocessor.else-branch.in-block",
"begin": "^\\s*((#)\\s*else\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*endif\\b))",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
},
{
"contentName": "comment.block.preprocessor.if-branch.in-block",
"begin": "^\\s*((#)\\s*elif\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
},
{
"begin": "\\n",
"end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))",
"patterns": [
{
"include": "#block_context"
}
]
}
]
},
"preprocessor_rule_enabled_elif": {
"begin": "^\\s*((#)\\s*elif\\b)(?=\\s*\\(*\\b0*1\\b\\)*\\s*(?:$|//|/\\*))",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*endif\\b))",
"patterns": [
{
"begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#comments_context"
},
{
"begin": "\\n",
"end": "(?=^\\s*((#)\\s*(?:endif)\\b))",
"patterns": [
{
"contentName": "comment.block.preprocessor.elif-branch",
"begin": "^\\s*((#)\\s*(else)\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*endif\\b))",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
},
{
"contentName": "comment.block.preprocessor.elif-branch",
"begin": "^\\s*((#)\\s*(elif)\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
},
{
"include": "$base"
}
]
}
]
},
"preprocessor_rule_enabled_elif_block": {
"begin": "^\\s*((#)\\s*elif\\b)(?=\\s*\\(*\\b0*1\\b\\)*\\s*(?:$|//|/\\*))",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*endif\\b))",
"patterns": [
{
"begin": "\\G(?=.)(?!//|/\\*(?!.*\\\\\\s*\\n))",
"end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.cpp",
"patterns": [
{
"include": "#preprocessor_rule_conditional_line_context"
}
]
},
{
"include": "#comments_context"
},
{
"begin": "\\n",
"end": "(?=^\\s*((#)\\s*(?:endif)\\b))",
"patterns": [
{
"contentName": "comment.block.preprocessor.elif-branch.in-block",
"begin": "^\\s*((#)\\s*(else)\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*endif\\b))",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
},
{
"contentName": "comment.block.preprocessor.elif-branch",
"begin": "^\\s*((#)\\s*(elif)\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*(?:else|elif|endif)\\b))",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma_mark"
}
]
},
{
"include": "#block_context"
}
]
}
]
},
"preprocessor_rule_enabled_else": {
"begin": "^\\s*((#)\\s*else\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*endif\\b))",
"patterns": [
{
"include": "$base"
}
]
},
"preprocessor_rule_enabled_else_block": {
"begin": "^\\s*((#)\\s*else\\b)",
"beginCaptures": {
"0": {
"name": "meta.preprocessor.cpp"
},
"1": {
"name": "keyword.control.directive.conditional.cpp"
},
"2": {
"name": "punctuation.definition.directive.cpp"
}
},
"end": "(?=^\\s*((#)\\s*endif\\b))",
"patterns": [
{
"include": "#block_context"
}
]
},
"preprocessor_rule_define_line_context": {
"patterns": [
{
"include": "#vararg_ellipses"
},
{
"match": "(?-mix:##?(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F]))(?:(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U000[0-9a-fA-F])))*(?!\\w))",
"name": "variable.other.macro.argument.cpp"
},
{
"begin": "{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.bracket.curly.cpp"
}
},
"end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)|(?<!\\\\)(?=\\s*\\n)",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.bracket.curly.cpp"
}
},
"name": "meta.block.cpp",
"patterns": [
{
"include": "#preprocessor_rule_define_line_blocks_context"
}
]
},
{
"match": "\\(",
"name": "punctuation.section.parens.begin.bracket.round.cpp"
},
{
"match": "\\)",
"name": "punctuation.section.parens.end.bracket.round.cpp"
},
{
"begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|return|typeid|alignof|alignas|sizeof|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas|asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void)\\s*\\()\n(?=\n (?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*\\( # actual name\n |\n (?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)",
"end": "(?<=\\))(?!\\w)|(?<!\\\\)(?=\\s*\\n)",
"name": "meta.function.cpp",
"patterns": [
{
"include": "#preprocessor_rule_define_line_functions_context"
}
]
},
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
}
},
"end": "\"|(?<!\\\\)(?=\\s*\\n)",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
}
},
"name": "string.quoted.double.cpp",
"patterns": [
{
"include": "#string_escapes_context_c"
},
{
"include": "#line_continuation_character"
}
]
},
{
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
}
},
"end": "'|(?<!\\\\)(?=\\s*\\n)",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
}
},
"name": "string.quoted.single.cpp",
"patterns": [
{
"include": "#string_escapes_context_c"
},
{
"include": "#line_continuation_character"
}
]
},
{
"include": "#method_access"
},
{
"include": "#member_access"
},
{
"include": "$base"
}
]
},
"preprocessor_rule_define_line_blocks_context": {
"patterns": [
{
"begin": "{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.bracket.curly.cpp"
}
},
"end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)|(?<!\\\\)(?=\\s*\\n)",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.bracket.curly.cpp"
}
},
"patterns": [
{
"include": "#preprocessor_rule_define_line_blocks_context"
},
{
"include": "#preprocessor_rule_define_line_context"
}
]
},
{
"include": "#preprocessor_rule_define_line_context"
}
]
},
"preprocessor_rule_define_line_functions_context": {
"patterns": [
{
"include": "#comments_context"
},
{
"include": "#storage_types"
},
{
"include": "#vararg_ellipses"
},
{
"include": "#method_access"
},
{
"include": "#member_access"
},
{
"include": "#operators"
},
{
"begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|return|typeid|alignof|alignas|sizeof|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++ # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()",
"beginCaptures": {
"1": {
"name": "entity.name.function.cpp"
},
"2": {
"name": "punctuation.section.arguments.begin.bracket.round.cpp"
}
},
"end": "(\\))|(?<!\\\\)(?=\\s*\\n)",
"endCaptures": {
"1": {
"name": "punctuation.section.arguments.end.bracket.round.cpp"
}
},
"patterns": [
{
"include": "#preprocessor_rule_define_line_functions_context"
}
]
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.parens.begin.bracket.round.cpp"
}
},
"end": "(\\))|(?<!\\\\)(?=\\s*\\n)",
"endCaptures": {
"1": {
"name": "punctuation.section.parens.end.bracket.round.cpp"
}
},
"patterns": [
{
"include": "#preprocessor_rule_define_line_functions_context"
}
]
},
{
"include": "#preprocessor_rule_define_line_context"
}
]
},
"function_context_c": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#comments_context"
},
{
"include": "#storage_types"
},
{
"include": "#operators"
},
{
"include": "#vararg_ellipses"
},
{
"include": "#legacy_function_definition"
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.parens.begin.bracket.round.cpp"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.parens.end.bracket.round.cpp"
}
},
"patterns": [
{
"include": "#function_context_c"
}
]
},
{
"include": "$base"
}
]
},
"function_call_context_c": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#comments_context"
},
{
"include": "#storage_types"
},
{
"include": "#method_access"
},
{
"include": "#member_access"
},
{
"include": "#operators"
},
{
"begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|return|typeid|alignof|alignas|sizeof|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(\n(?:new)\\s*((?-mix:(?:(?-mix:(?:(?<!<)<(?!<)(?:[\\s<>:,\\w])*>\\s*)))?)) # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()",
"beginCaptures": {
"1": {
"name": "keyword.operator.wordlike.cpp memory.cpp keyword.operator.new.cpp"
},
"2": {
"patterns": [
{
"include": "#template_call_innards"
}
]
},
"3": {
"name": "punctuation.section.arguments.begin.bracket.round.cpp"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.arguments.end.bracket.round.cpp"
}
},
"patterns": [
{
"include": "#function_call_context_c"
}
]
},
{
"include": "#function_call"
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.parens.begin.bracket.round.cpp"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.parens.end.bracket.round.cpp"
}
},
"patterns": [
{
"include": "#function_call_context_c"
}
]
},
{
"include": "#block_context"
}
]
}
}
}