tm-grammars
Version:
Collecton of TextMate grammars in JSON
1,471 lines (1,470 loc) • 619 kB
JSON
{
"displayName": "C++",
"name": "cpp",
"patterns": [
{
"include": "#ever_present_context"
},
{
"include": "#constructor_root"
},
{
"include": "#destructor_root"
},
{
"include": "#function_definition"
},
{
"include": "#operator_overload"
},
{
"include": "#using_namespace"
},
{
"include": "#type_alias"
},
{
"include": "#using_name"
},
{
"include": "#namespace_alias"
},
{
"include": "#namespace_block"
},
{
"include": "#extern_block"
},
{
"include": "#typedef_class"
},
{
"include": "#typedef_struct"
},
{
"include": "#typedef_union"
},
{
"include": "#misc_keywords"
},
{
"include": "#standard_declares"
},
{
"include": "#class_block"
},
{
"include": "#struct_block"
},
{
"include": "#union_block"
},
{
"include": "#enum_block"
},
{
"include": "#template_isolated_definition"
},
{
"include": "#template_definition"
},
{
"include": "#template_explicit_instantiation"
},
{
"include": "#access_control_keywords"
},
{
"include": "#block"
},
{
"include": "#static_assert"
},
{
"include": "#assembly"
},
{
"include": "#function_pointer"
},
{
"include": "#evaluation_context"
}
],
"repository": {
"access_control_keywords": {
"captures": {
"1": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"2": {
"patterns": [
{
"captures": {
"1": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"2": {
"name": "comment.block.cpp"
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"match": "\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+"
}
]
},
"3": {
"name": "storage.type.modifier.access.control.$4.cpp"
},
"4": {
},
"5": {
"name": "punctuation.separator.colon.access.control.cpp"
}
},
"match": "(((?:\\s*+/\\*(?:[^*]++|\\*+(?!/))*+\\*/\\s*+)+)|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)((p(?:rotected|rivate|ublic))\\s+{0,1}(:))"
},
"alignas_attribute": {
"begin": "alignas\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.attribute.begin.cpp"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.attribute.end.cpp"
}
},
"name": "support.other.attribute.cpp",
"patterns": [
{
"include": "#attributes_context"
},
{
"begin": "\\(",
"beginCaptures": {
},
"end": "\\)",
"endCaptures": {
},
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#string_context"
},
{
"include": "#ever_present_context"
}
]
},
{
"captures": {
"1": {
"name": "keyword.other.using.directive.cpp"
},
"2": {
"name": "entity.name.namespace.cpp"
}
},
"match": "(using)\\s+((?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w))"
},
{
"match": ",",
"name": "punctuation.separator.attribute.cpp"
},
{
"match": ":",
"name": "punctuation.accessor.attribute.cpp"
},
{
"match": "(?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w)(?=::)",
"name": "entity.name.namespace.cpp"
},
{
"match": "(?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w)",
"name": "entity.other.attribute.$0.cpp"
},
{
"include": "#number_literal"
},
{
"include": "#ever_present_context"
}
]
},
"alignas_operator": {
"begin": "((?<!\\w)alignas(?!\\w))((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)(\\()",
"beginCaptures": {
"1": {
"name": "keyword.operator.functionlike.cpp keyword.operator.alignas.cpp"
},
"2": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"4": {
"name": "comment.block.cpp"
},
"5": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"6": {
"name": "punctuation.section.arguments.begin.bracket.round.operator.alignas.cpp"
}
},
"contentName": "meta.arguments.operator.alignas",
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.arguments.end.bracket.round.operator.alignas.cpp"
}
},
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"alignof_operator": {
"begin": "((?<!\\w)alignof(?!\\w))((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)(\\()",
"beginCaptures": {
"1": {
"name": "keyword.operator.functionlike.cpp keyword.operator.alignof.cpp"
},
"2": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"4": {
"name": "comment.block.cpp"
},
"5": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"6": {
"name": "punctuation.section.arguments.begin.bracket.round.operator.alignof.cpp"
}
},
"contentName": "meta.arguments.operator.alignof",
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.arguments.end.bracket.round.operator.alignof.cpp"
}
},
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"assembly": {
"begin": "\\b(__asm__|asm)\\b\\s+{0,1}((?:volatile)?)",
"beginCaptures": {
"1": {
"name": "storage.type.asm.cpp"
},
"2": {
"name": "storage.modifier.cpp"
}
},
"end": "(?!\\G)",
"endCaptures": {
},
"name": "meta.asm.cpp",
"patterns": [
{
"captures": {
"1": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"2": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"3": {
"name": "comment.block.cpp"
},
"4": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"match": "^((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)(?:\\n|$)"
},
{
"include": "#comments"
},
{
"begin": "((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.parens.begin.bracket.round.assembly.cpp"
},
"1": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"2": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"3": {
"name": "comment.block.cpp"
},
"4": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.parens.end.bracket.round.assembly.cpp"
}
},
"patterns": [
{
"begin": "(R?)(\")",
"beginCaptures": {
"1": {
"name": "meta.encoding.cpp"
},
"2": {
"name": "punctuation.definition.string.begin.assembly.cpp"
}
},
"contentName": "meta.embedded.assembly",
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.assembly.cpp"
}
},
"name": "string.quoted.double.cpp",
"patterns": [
{
"include": "source.asm"
},
{
"include": "source.x86"
},
{
"include": "source.x86_64"
},
{
"include": "source.arm"
},
{
"include": "#backslash_escapes"
},
{
"include": "#string_escaped_char"
}
]
},
{
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.parens.begin.bracket.round.assembly.inner.cpp"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.parens.end.bracket.round.assembly.inner.cpp"
}
},
"patterns": [
{
"include": "#evaluation_context"
}
]
},
{
"captures": {
"1": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"2": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"3": {
"name": "comment.block.cpp"
},
"4": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"5": {
"name": "variable.other.asm.label.cpp"
},
"6": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"7": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"8": {
"name": "comment.block.cpp"
},
"9": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"match": "\\[((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)((?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*)((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)]"
},
{
"match": ":",
"name": "punctuation.separator.delimiter.colon.assembly.cpp"
},
{
"include": "#comments"
}
]
}
]
},
"assignment_operator": {
"match": "=",
"name": "keyword.operator.assignment.cpp"
},
"attributes_context": {
"patterns": [
{
"include": "#cpp_attributes"
},
{
"include": "#gcc_attributes"
},
{
"include": "#ms_attributes"
},
{
"include": "#alignas_attribute"
}
]
},
"backslash_escapes": {
"match": "\\\\([\"'?\\\\abefnprtv]|[0-3][0-7]{0,2}|[4-7]\\d?|x\\h{0,2}|u\\h{0,4}|U\\h{0,8})",
"name": "constant.character.escape"
},
"block": {
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.bracket.curly.cpp"
}
},
"end": "}",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.bracket.curly.cpp"
}
},
"name": "meta.block.cpp",
"patterns": [
{
"include": "#function_body_context"
}
]
},
"block_comment": {
"begin": "\\s*+(/\\*)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.comment.begin.cpp"
}
},
"end": "\\*/",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.cpp"
}
},
"name": "comment.block.cpp"
},
"builtin_storage_type_initilizer": {
"begin": "\\s*+(?<!\\w)(?:(?:(?:(unsigned|wchar_t|double|signed|short|float|auto|void|long|char|bool|int)|(uint_least32_t|uint_least64_t|uint_least16_t|uint_fast64_t|uint_least8_t|int_least64_t|int_least32_t|int_least16_t|uint_fast16_t|uint_fast32_t|int_least8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|int_fast8_t|suseconds_t|useconds_t|uintmax_t|in_port_t|uintmax_t|in_addr_t|blksize_t|uintptr_t|intmax_t|intptr_t|blkcnt_t|intmax_t|u_quad_t|uint16_t|uint32_t|uint64_t|ssize_t|fixpt_t|qaddr_t|u_short|int16_t|int32_t|int64_t|uint8_t|daddr_t|caddr_t|swblk_t|clock_t|segsz_t|nlink_t|time_t|u_long|ushort|quad_t|mode_t|size_t|u_char|int8_t|u_int|uid_t|off_t|pid_t|gid_t|dev_t|div_t|key_t|ino_t|id_t|uint))|(pthread_(?:rwlockattr_|mutexattr_|condattr_|rwlock_|mutex_|cond_|attr_|once_|key_|)t))|([A-Z_a-z]\\w*_t))(?!\\w)\\s*+(?<!\\w)(\\()",
"beginCaptures": {
"1": {
"name": "storage.type.primitive.cpp storage.type.built-in.primitive.cpp"
},
"2": {
"name": "storage.type.cpp storage.type.built-in.cpp"
},
"3": {
"name": "support.type.posix-reserved.pthread.cpp support.type.built-in.posix-reserved.pthread.cpp"
},
"4": {
"name": "support.type.posix-reserved.cpp support.type.built-in.posix-reserved.cpp"
},
"5": {
"name": "punctuation.section.arguments.begin.bracket.round.initializer.cpp"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.arguments.end.bracket.round.initializer.cpp"
}
},
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"case_statement": {
"begin": "((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)((?<!\\w)case(?!\\w))",
"beginCaptures": {
"1": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"2": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"3": {
"name": "comment.block.cpp"
},
"4": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"5": {
"name": "keyword.control.case.cpp"
}
},
"end": ":",
"endCaptures": {
"0": {
"name": "punctuation.separator.colon.case.cpp"
}
},
"name": "meta.conditional.case.cpp",
"patterns": [
{
"include": "#evaluation_context"
}
]
},
"class_block": {
"begin": "((?<!\\w)class(?!\\w))((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)(?:(?=\\{)|(?:((?:(?:(?:\\[\\[.*?]]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z))?((?:(?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w)((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z))*+)?(?:((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)(:(?!:)))?)",
"beginCaptures": {
"0": {
"name": "meta.head.class.cpp"
},
"1": {
"name": "storage.type.$1.cpp"
},
"10": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"11": {
"patterns": [
{
"captures": {
"1": {
"name": "storage.type.modifier.final.cpp"
},
"2": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"4": {
"name": "comment.block.cpp"
},
"5": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"match": "((?<!\\w)final(?!\\w))((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)"
},
{
"captures": {
"1": {
"name": "entity.name.type.class.cpp"
},
"10": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"2": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"4": {
"name": "comment.block.cpp"
},
"5": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"6": {
"name": "storage.type.modifier.final.cpp"
},
"7": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"8": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"9": {
"name": "comment.block.cpp"
}
},
"match": "((?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w))((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)(?:((?<!\\w)final(?!\\w))((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z))?(?=[:{]|$)"
},
{
"match": "DLLEXPORT",
"name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp"
},
{
"match": "(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*",
"name": "entity.name.other.preprocessor.macro.predefined.probably.$0.cpp"
}
]
},
"12": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"13": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"14": {
"name": "comment.block.cpp"
},
"15": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"16": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"17": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"18": {
"name": "comment.block.cpp"
},
"19": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"2": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"20": {
"name": "punctuation.separator.colon.inheritance.cpp"
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"4": {
"name": "comment.block.cpp"
},
"5": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"6": {
"patterns": [
{
"include": "#attributes_context"
},
{
"include": "#number_literal"
}
]
},
"7": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"8": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"9": {
"name": "comment.block.cpp"
}
},
"end": "(?:(?<=}|%>|\\?\\?>)\\s+{0,1}(;)|(;))|(?=[];=>\\[])",
"endCaptures": {
"1": {
"name": "punctuation.terminator.statement.cpp"
},
"2": {
"name": "punctuation.terminator.statement.cpp"
}
},
"name": "meta.block.class.cpp",
"patterns": [
{
"begin": "\\G ?",
"beginCaptures": {
},
"end": "\\{|<%|\\?\\?<|(?=;)",
"endCaptures": {
"0": {
"name": "punctuation.section.block.begin.bracket.curly.class.cpp"
}
},
"name": "meta.head.class.cpp",
"patterns": [
{
"include": "#ever_present_context"
},
{
"include": "#inheritance_context"
},
{
"include": "#template_call_range"
}
]
},
{
"begin": "(?<=\\{|<%|\\?\\?<)",
"beginCaptures": {
},
"end": "}|%>|\\?\\?>",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.bracket.curly.class.cpp"
}
},
"name": "meta.body.class.cpp",
"patterns": [
{
"include": "#function_pointer"
},
{
"include": "#static_assert"
},
{
"include": "#constructor_inline"
},
{
"include": "#destructor_inline"
},
{
"include": "$self"
}
]
},
{
"begin": "(?<=}|%>|\\?\\?>)\\s*",
"beginCaptures": {
},
"end": "\\s*(?=;)",
"endCaptures": {
},
"name": "meta.tail.class.cpp",
"patterns": [
{
"include": "$self"
}
]
}
]
},
"class_declare": {
"captures": {
"1": {
"name": "storage.type.class.declare.cpp"
},
"10": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"11": {
"patterns": [
{
"captures": {
"1": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"2": {
"name": "comment.block.cpp"
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"match": "\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+"
}
]
},
"12": {
"name": "variable.other.object.declare.cpp"
},
"13": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"14": {
"patterns": [
{
"captures": {
"1": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"2": {
"name": "comment.block.cpp"
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"match": "\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+"
}
]
},
"2": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"3": {
"patterns": [
{
"captures": {
"1": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"2": {
"name": "comment.block.cpp"
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"match": "\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+"
}
]
},
"4": {
"name": "entity.name.type.class.cpp"
},
"5": {
"patterns": [
{
"match": "\\*",
"name": "storage.modifier.pointer.cpp"
},
{
"captures": {
"1": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"2": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"3": {
"name": "comment.block.cpp"
},
"4": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"match": "(?:&((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)){2,}&",
"name": "invalid.illegal.reference-type.cpp"
},
{
"match": "&",
"name": "storage.modifier.reference.cpp"
}
]
},
"6": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"7": {
"patterns": [
{
"captures": {
"1": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"2": {
"name": "comment.block.cpp"
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"match": "\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+"
}
]
},
"8": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"9": {
"patterns": [
{
"captures": {
"1": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"2": {
"name": "comment.block.cpp"
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"match": "\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+"
}
]
}
},
"match": "((?<!\\w)class(?!\\w))(((?:\\s*+/\\*(?:[^*]++|\\*+(?!/))*+\\*/\\s*+)+)|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)((?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w))((((?:\\s*+/\\*(?:[^*]++|\\*+(?!/))*+\\*/\\s*+)+)|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)?(?:[\\&*](((?:\\s*+/\\*(?:[^*]++|\\*+(?!/))*+\\*/\\s*+)+)|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z))*[\\&*])?(((?:\\s*+/\\*(?:[^*]++|\\*+(?!/))*+\\*/\\s*+)+)|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)\\b(?!override\\W|override\\$|final\\W|final\\$)((?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w))(((?:\\s*+/\\*(?:[^*]++|\\*+(?!/))*+\\*/\\s*+)+)|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)(?=\\S)(?![:A-Za-{])"
},
"comma": {
"match": ",",
"name": "punctuation.separator.delimiter.comma.cpp"
},
"comma_in_template_argument": {
"match": ",",
"name": "punctuation.separator.delimiter.comma.template.argument.cpp"
},
"comments": {
"patterns": [
{
"begin": "^\\s+{1,0}(//[!/]+)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.comment.documentation.cpp"
}
},
"end": "(?<=\\n)(?<!\\\\\\n)",
"endCaptures": {
},
"name": "comment.line.double-slash.documentation.cpp",
"patterns": [
{
"include": "#line_continuation_character"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:callergraph|callgraph|else|endif|f\\$|f\\[|f]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|[\"-%.<=>]|::|\\||---??)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"name": "markup.italic.doxygen.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\](?:a|em?))\\s+(\\S+)"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"name": "markup.bold.doxygen.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\]b)\\s+(\\S+)"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"name": "markup.inline.raw.string.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\][cp])\\s+(\\S+)"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:a|anchor|[bc]|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|em??|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"patterns": [
{
"match": "in|out",
"name": "keyword.other.parameter.direction.$0.cpp"
}
]
},
"3": {
"patterns": [
{
"match": "(?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w)",
"name": "variable.parameter.cpp"
},
{
"match": ",",
"name": "punctuation.cpp"
}
]
},
"4": {
"name": "variable.parameter.cpp"
},
"5": {
"name": "punctuation.cpp"
},
"6": {
"name": "variable.parameter.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\]param)(?:\\s*\\[((?:,?\\s+{0,1}(?:in|out)\\s+{0,1})+)])?(\\s+((?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w))(?:(,)\\s+{0,1}((?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w)))*)"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:arg|attention|authors??|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remarks??|result|returns??|retval|sa|see|short|since|test|throws??|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|startuml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"match": "\\b[A-Z]+:|@[_a-z]+:",
"name": "storage.type.class.gtkdoc.cpp"
}
]
},
{
"captures": {
"1": {
"name": "punctuation.definition.comment.begin.documentation.cpp"
},
"2": {
"patterns": [
{
"match": "(?<=[!*/\\s])[@\\\\](?:callergraph|callgraph|else|endif|f\\$|f\\[|f]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|[\"-%.<=>]|::|\\||---??)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"name": "markup.italic.doxygen.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\](?:a|em?))\\s+(\\S+)"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"name": "markup.bold.doxygen.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\]b)\\s+(\\S+)"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"name": "markup.inline.raw.string.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\][cp])\\s+(\\S+)"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:a|anchor|[bc]|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|em??|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"patterns": [
{
"match": "in|out",
"name": "keyword.other.parameter.direction.$0.cpp"
}
]
},
"3": {
"patterns": [
{
"match": "(?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w)",
"name": "variable.parameter.cpp"
},
{
"match": ",",
"name": "punctuation.cpp"
}
]
},
"4": {
"name": "variable.parameter.cpp"
},
"5": {
"name": "punctuation.cpp"
},
"6": {
"name": "variable.parameter.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\]param)(?:\\s*\\[((?:,?\\s+{0,1}(?:in|out)\\s+{0,1})+)])?(\\s+((?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w))(?:(,)\\s+{0,1}((?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w)))*)"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:arg|attention|authors??|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remarks??|result|returns??|retval|sa|see|short|since|test|throws??|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|startuml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"match": "\\b[A-Z]+:|@[_a-z]+:",
"name": "storage.type.class.gtkdoc.cpp"
}
]
},
"3": {
"name": "punctuation.definition.comment.end.documentation.cpp"
}
},
"match": "(/\\*[!*]+(?=\\s))(.+)([!*]*\\*/)",
"name": "comment.block.documentation.cpp"
},
{
"begin": "\\s+{1,0}/\\*[!*]+(?:(?:\\n|$)|(?=\\s))",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.begin.documentation.cpp"
}
},
"end": "[!*]*\\*/",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.documentation.cpp"
}
},
"name": "comment.block.documentation.cpp",
"patterns": [
{
"match": "(?<=[!*/\\s])[@\\\\](?:callergraph|callgraph|else|endif|f\\$|f\\[|f]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitializer|showrefby|showrefs|tableofcontents|[\"-%.<=>]|::|\\||---??)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"name": "markup.italic.doxygen.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\](?:a|em?))\\s+(\\S+)"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"name": "markup.bold.doxygen.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\]b)\\s+(\\S+)"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"name": "markup.inline.raw.string.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\][cp])\\s+(\\S+)"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:a|anchor|[bc]|cite|copybrief|copydetail|copydoc|def|dir|dontinclude|em??|emoji|enum|example|extends|file|idlexcept|implements|include|includedoc|includelineno|latexinclude|link|memberof|namespace|p|package|ref|refitem|related|relates|relatedalso|relatesalso|verbinclude)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:addindex|addtogroup|category|class|defgroup|diafile|dotfile|elseif|fn|headerfile|if|ifnot|image|ingroup|interface|line|mainpage|mscfile|name|overload|page|property|protocol|section|skip|skipline|snippet|snippetdoc|snippetlineno|struct|subpage|subsection|subsubsection|typedef|union|until|vhdlflow|weakgroup)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"captures": {
"1": {
"name": "storage.type.class.doxygen.cpp"
},
"2": {
"patterns": [
{
"match": "in|out",
"name": "keyword.other.parameter.direction.$0.cpp"
}
]
},
"3": {
"patterns": [
{
"match": "(?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w)",
"name": "variable.parameter.cpp"
},
{
"match": ",",
"name": "punctuation.cpp"
}
]
},
"4": {
"name": "variable.parameter.cpp"
},
"5": {
"name": "punctuation.cpp"
},
"6": {
"name": "variable.parameter.cpp"
}
},
"match": "((?<=[!*/\\s])[@\\\\]param)(?:\\s*\\[((?:,?\\s+{0,1}(?:in|out)\\s+{0,1})+)])?(\\s+((?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w))(?:(,)\\s+{0,1}((?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w)))*)"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:arg|attention|authors??|brief|bug|copyright|date|deprecated|details|exception|invariant|li|note|par|paragraph|param|post|pre|remarks??|result|returns??|retval|sa|see|short|since|test|throws??|todo|tparam|version|warning|xrefitem)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"match": "(?<=[!*/\\s])[@\\\\](?:code|cond|docbookonly|dot|htmlonly|internal|latexonly|link|manonly|msc|parblock|rtfonly|secreflist|startuml|verbatim|xmlonly|endcode|endcond|enddocbookonly|enddot|endhtmlonly|endinternal|endlatexonly|endlink|endmanonly|endmsc|endparblock|endrtfonly|endsecreflist|enduml|endverbatim|endxmlonly)\\b(?:\\{[^}]*})?",
"name": "storage.type.class.doxygen.cpp"
},
{
"match": "\\b[A-Z]+:|@[_a-z]+:",
"name": "storage.type.class.gtkdoc.cpp"
}
]
},
{
"include": "#emacs_file_banner"
},
{
"include": "#block_comment"
},
{
"include": "#line_comment"
},
{
"include": "#invalid_comment_end"
}
]
},
"constructor_inline": {
"begin": "^((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)((?:(?:constexpr|consteval|explicit|mutable|virtual|inline|friend)((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z))*)((?:__(?:cdec|clrcal|stdcal|fastcal|thiscal|vectorcal)l)?)((?:\\s*+(/\\*)((?:[^*]++|\\*+(?!/))*+(\\*/))\\s*+)+|\\s++|(?<=\\W)|(?=\\W)|^|\\n?$|\\A|\\Z)((?<!\\w)(?:[A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))(?:[0-9A-Z_a-z]|\\\\(?:u\\h{4}|U\\h{8}))*(?!\\w)(?=\\())",
"beginCaptures": {
"0": {
"name": "meta.head.function.definition.special.constructor.cpp"
},
"1": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"10": {
"name": "storage.type.modifier.calling-convention.cpp"
},
"11": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"12": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"13": {
"name": "comment.block.cpp"
},
"14": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"15": {
"name": "entity.name.function.constructor.cpp entity.name.function.definition.special.constructor.cpp"
},
"2": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"3": {
"name": "comment.block.cpp"
},
"4": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"5": {
"patterns": [
{
"include": "#functional_specifiers_pre_parameters"
}
]
},
"6": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"7": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"8": {
"name": "comment.block.cpp"
},
"9": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
}
},
"end": "(?<=}|%>|\\?\\?>)|(?=[];=>\\[])",
"endCaptures": {
},
"name": "meta.function.definition.special.constructor.cpp",
"patterns": [
{
"begin": "\\G ?",
"beginCaptures": {
},
"end": "\\{|<%|\\?\\?<|(?=;)",
"endCaptures": {
"0": {
"name": "punctuation.section.block.begin.bracket.curly.function.definition.special.constructor.cpp"
}
},
"name": "meta.head.function.definition.special.constructor.cpp",
"patterns": [
{
"include": "#ever_present_context"
},
{
"captures": {
"1": {
"name": "keyword.operator.assignment.cpp"
},
"2": {
"patterns": [
{
"include": "#inline_comment"
}
]
},
"3": {
"name": "comment.block.cpp punctuation.definition.comment.begin.cpp"
},
"4": {
"name": "comment.block.cpp"
},
"5": {
"name": "comment.block.cpp punctuation.definition.comment.end.cpp"
},
"6": {
"name": "keyword.other.default.function.cpp keyword.other.default.constructor.cpp"