From 5b11bee663f4cbd397a794972dbe35502b9f85f4 Mon Sep 17 00:00:00 2001 From: Jeff Hykin Date: Fri, 10 May 2019 19:57:59 -0500 Subject: [PATCH] fix the unit tests for reference dereference --- cpp/generate.rb | 2 +- syntaxes/cpp.tmLanguage.json | 2 +- syntaxes/cpp.tmLanguage.yaml | 38 ++++++++++++++++++------------------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cpp/generate.rb b/cpp/generate.rb index 7fcb11f4..fe373b4f 100644 --- a/cpp/generate.rb +++ b/cpp/generate.rb @@ -31,7 +31,7 @@ # TODO eventually move this outside of the # Utils section ref_deref_definition_pattern = newPattern( should_fully_match: [ '*', '&', '**', '&&', '*&', '*& ' ], - should_not_partial_match: [ '&*', '&&&' ], + should_not_fully_match: [ '&*', '&&&' ], match: newPattern( match: zeroOrMoreOf(/\*/.maybe(@spaces)), tag_as: "storage.modifier.pointer" diff --git a/syntaxes/cpp.tmLanguage.json b/syntaxes/cpp.tmLanguage.json index 5866a82d..5f4298c0 100644 --- a/syntaxes/cpp.tmLanguage.json +++ b/syntaxes/cpp.tmLanguage.json @@ -1 +1 @@ -{"name":"C++","scopeName":"source.cpp","version":"https://github.com/jeff-hykin/cpp-textmate-grammar/blob/master/syntaxes/cpp.tmLanguage.json","information_for_contributors":["This code was auto generated by a much-more-readble ruby file: https://github.com/jeff-hykin/cpp-textmate-grammar/blob/master/generate.rb","This file essentially an updated/improved fork of the atom syntax https://github.com/atom/language-c/blob/master/grammars/c%2B%2B.cson"],"patterns":[{"include":"#parameter_struct"},{"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":"((?\\[\\]=]))","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"}]},{"name":"meta.tail.switch.cpp","begin":"(?<=})[\\s\\n]*","end":"[\\s\\n]*(?=;)","patterns":[{"include":"$base"}]}]},"attributes":{"name":"support.other.attribute.cpp","begin":"((?:\\[\\[|__attribute\\(\\(|__attribute__\\(\\(|__declspec\\())","beginCaptures":{"1":{"name":"punctuation.section.attribute.begin.cpp"}},"end":"((?:\\]\\]|\\)\\)|\\)))","endCaptures":{"1":{"name":"punctuation.section.attribute.end.cpp"}},"patterns":[{"include":"#attributes"},{"begin":"\\(","end":"\\)","patterns":[{"include":"#attributes"},{"include":"#string_context_c"}]},{"match":"(using)\\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":"(?\\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":"(?)","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:(?:(?:,\\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*(?:((?:,\\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])*>\\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*(?:[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:(?:(?:,\\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"}]},"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"}}},"struct_declare":{"match":"(struct)\\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*(?:((?:,\\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"}]},"operators":{"patterns":[{"include":"#sizeof_operator"},{"include":"#alignof_operator"},{"include":"#alignas_operator"},{"include":"#typeid_operator"},{"include":"#decltype_specifier"},{"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"}]}]},"assignment_operator":{"match":"\\=","name":"keyword.operator.assignment.cpp"},"function_pointer":{"begin":"(\\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*(?:((?:,\\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:(?:(?:,\\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"}]},"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"},"8":{"name":"storage.modifier.pointer.cpp"},"9":{"name":"storage.modifier.reference.cpp"},"10":{"name":"punctuation.section.parens.begin.bracket.round.function.pointer.cpp"},"11":{"name":"punctuation.definition.function.pointer.dereference.cpp"},"12":{"name":"variable.other.definition.pointer.function.cpp"},"13":{"name":"punctuation.definition.begin.bracket.square.cpp"},"14":{"patterns":[{"include":"#evaluation_context"}]},"15":{"name":"punctuation.definition.end.bracket.square.cpp"},"16":{"name":"punctuation.section.parens.end.bracket.round.function.pointer.cpp"},"17":{"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:(?:(?:,\\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":"(?:((?\\*|->)))((?:(?:[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:(?:(?:(?\\*|->))))","name":"variable.other.object.property.cpp"},{"match":"(?:((?\\*|->)))","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":"(?:((?\\*|->)))((?:(?:[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:(?:(?:(?\\*|->))))","name":"variable.other.object.property.cpp"},{"match":"(?:((?\\*|->)))","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])*>\\s*)))?::)*\\s*))?((?:,\\w])*>\\s*)))?::)*\\s*)\\s*(?:((?\\[\\]=]))","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]|^)(?)(.+?(?=\\{|$))?","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])*>\\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*((?\\[\\]=]))","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":"(?\\[\\]=]))","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":"((((?\\[\\]=]))","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":"((((?\\[\\]=]))","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":"(?(?-mix:[a-zA-Z_$][\\w$]*)))\t # macro name\n(?:\n (\\()\n\t(\n\t \\s* \\g \\s*\t\t # first argument\n\t ((,) \\s* \\g \\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":"(?=(?://|/\\*))|(?","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)\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:(?:(?:,\\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:(?=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)","end":"(?<=\\))(?!\\w)|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()","beginCaptures":{"1":{"name":"entity.name.function.cpp"},"2":{"name":"punctuation.section.arguments.begin.bracket.round.cpp"}},"end":"(\\))|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()","beginCaptures":{"1":{"name":"entity.name.function.cpp"},"2":{"name":"punctuation.section.parameters.begin.bracket.round.cpp"}},"end":"(?-mix:\\)|:)","endCaptures":{"0":{"name":"punctuation.section.parameters.end.bracket.round.cpp"}},"patterns":[{"include":"#probably_a_parameter"},{"include":"#function_context_c"}]},{"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"},{"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:(?:(?:,\\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"}]}}} \ No newline at end of file +{"name":"C++","scopeName":"source.cpp","version":"https://github.com/jeff-hykin/cpp-textmate-grammar/blob/master/syntaxes/cpp.tmLanguage.json","information_for_contributors":["This code was auto generated by a much-more-readble ruby file: https://github.com/jeff-hykin/cpp-textmate-grammar/blob/master/generate.rb","This file essentially an updated/improved fork of the atom syntax https://github.com/atom/language-c/blob/master/grammars/c%2B%2B.cson"],"patterns":[{"include":"#parameter_struct"},{"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":"((?\\[\\]=]))","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"}]},{"name":"meta.tail.switch.cpp","begin":"(?<=})[\\s\\n]*","end":"[\\s\\n]*(?=;)","patterns":[{"include":"$base"}]}]},"attributes":{"name":"support.other.attribute.cpp","begin":"((?:\\[\\[|__attribute\\(\\(|__attribute__\\(\\(|__declspec\\())","beginCaptures":{"1":{"name":"punctuation.section.attribute.begin.cpp"}},"end":"((?:\\]\\]|\\)\\)|\\)))","endCaptures":{"1":{"name":"punctuation.section.attribute.end.cpp"}},"patterns":[{"include":"#attributes"},{"begin":"\\(","end":"\\)","patterns":[{"include":"#attributes"},{"include":"#string_context_c"}]},{"match":"(using)\\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":"(?\\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":"(?)","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:(?:(?:,\\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*(?:((?:,\\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])*>\\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*(?:[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:(?:(?:,\\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"}]},"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"}}},"struct_declare":{"match":"(struct)\\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*(?:((?:,\\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"}]},"operators":{"patterns":[{"include":"#sizeof_operator"},{"include":"#alignof_operator"},{"include":"#alignas_operator"},{"include":"#typeid_operator"},{"include":"#decltype_specifier"},{"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"}]}]},"assignment_operator":{"match":"\\=","name":"keyword.operator.assignment.cpp"},"function_pointer":{"begin":"(\\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*(?:((?:,\\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:(?:(?:,\\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"}]},"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:(?:(?:,\\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":"(?:((?\\*|->)))((?:(?:[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:(?:(?:(?\\*|->))))","name":"variable.other.object.property.cpp"},{"match":"(?:((?\\*|->)))","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":"(?:((?\\*|->)))((?:(?:[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:(?:(?:(?\\*|->))))","name":"variable.other.object.property.cpp"},{"match":"(?:((?\\*|->)))","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])*>\\s*)))?::)*\\s*))?((?:,\\w])*>\\s*)))?::)*\\s*)\\s*(?:((?\\[\\]=]))","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]|^)(?)(.+?(?=\\{|$))?","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])*>\\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*((?\\[\\]=]))","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":"(?\\[\\]=]))","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":"((((?\\[\\]=]))","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":"((((?\\[\\]=]))","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":"(?(?-mix:[a-zA-Z_$][\\w$]*)))\t # macro name\n(?:\n (\\()\n\t(\n\t \\s* \\g \\s*\t\t # first argument\n\t ((,) \\s* \\g \\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":"(?=(?://|/\\*))|(?","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)\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:(?:(?:,\\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:(?=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)","end":"(?<=\\))(?!\\w)|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()","beginCaptures":{"1":{"name":"entity.name.function.cpp"},"2":{"name":"punctuation.section.arguments.begin.bracket.round.cpp"}},"end":"(\\))|(?=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()","beginCaptures":{"1":{"name":"entity.name.function.cpp"},"2":{"name":"punctuation.section.parameters.begin.bracket.round.cpp"}},"end":"(?-mix:\\)|:)","endCaptures":{"0":{"name":"punctuation.section.parameters.end.bracket.round.cpp"}},"patterns":[{"include":"#probably_a_parameter"},{"include":"#function_context_c"}]},{"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"},{"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:(?:(?:,\\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"}]}}} \ No newline at end of file diff --git a/syntaxes/cpp.tmLanguage.yaml b/syntaxes/cpp.tmLanguage.yaml index e58710f1..bba98d9d 100644 --- a/syntaxes/cpp.tmLanguage.yaml +++ b/syntaxes/cpp.tmLanguage.yaml @@ -604,30 +604,30 @@ '6': name: punctuation.separator.namespace.access.cpp struct_declare: - match: "(struct)\\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*(?:((?:,\\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:(?:(?:,\\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*(\\()" + begin: "(\\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*(?:((?:,\\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:(?:(?:,\\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 @@ -757,26 +757,26 @@ - include: "#template_call_context" '7': name: punctuation.separator.namespace.access.cpp - '8': - name: storage.modifier.pointer.cpp '9': - name: storage.modifier.reference.cpp + name: storage.modifier.pointer.cpp '10': - name: punctuation.section.parens.begin.bracket.round.function.pointer.cpp + name: storage.modifier.reference.cpp '11': - name: punctuation.definition.function.pointer.dereference.cpp + name: punctuation.section.parens.begin.bracket.round.function.pointer.cpp '12': - name: variable.other.definition.pointer.function.cpp + name: punctuation.definition.function.pointer.dereference.cpp '13': - name: punctuation.definition.begin.bracket.square.cpp + name: variable.other.definition.pointer.function.cpp '14': + name: punctuation.definition.begin.bracket.square.cpp + '15': patterns: - include: "#evaluation_context" - '15': - name: punctuation.definition.end.bracket.square.cpp '16': - name: punctuation.section.parens.end.bracket.round.function.pointer.cpp + 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: