diff --git a/extensions/cpp/cgmanifest.json b/extensions/cpp/cgmanifest.json index 08cd245eac1..43485f926a8 100644 --- a/extensions/cpp/cgmanifest.json +++ b/extensions/cpp/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "jeff-hykin/cpp-textmate-grammar", "repositoryUrl": "https://github.com/jeff-hykin/cpp-textmate-grammar", - "commitHash": "d57808aa3db2242f1f2be1aec19649a852aaa52e" + "commitHash": "47f33650b7eee1cc3d5c9e72a85ac415797a08db" } }, "license": "MIT", - "version": "1.4.5", + "version": "1.6.7", "description": "The files syntaxes/c.json and syntaxes/c++.json were derived from https://github.com/atom/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." }, { diff --git a/extensions/cpp/syntaxes/cpp.tmLanguage.json b/extensions/cpp/syntaxes/cpp.tmLanguage.json index c3c6d813d97..74780872397 100644 --- a/extensions/cpp/syntaxes/cpp.tmLanguage.json +++ b/extensions/cpp/syntaxes/cpp.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/d57808aa3db2242f1f2be1aec19649a852aaa52e", + "version": "https://github.com/jeff-hykin/cpp-textmate-grammar/commit/47f33650b7eee1cc3d5c9e72a85ac415797a08db", "name": "C++", "scopeName": "source.cpp", "patterns": [ @@ -12,93 +12,61 @@ "include": "#special_block" }, { - "match": "(?-mix:##[a-zA-Z_]\\w*(?!\\w))", + "match": "##[a-zA-Z_]\\w*(?!\\w)", "name": "variable.other.macro.argument.cpp" }, { "include": "#strings" }, { - "match": "(?[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)?", + "name": "meta.preprocessor.macro.cpp", + "begin": "(?x)\n^\\s* ((\\#)\\s*define) \\s+\t# define\n((?(?-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" @@ -205,7 +173,6 @@ } }, "end": "(?=(?://|/\\*))|(?,\\w])*>\\s*", "captures": { "0": { + "name": "meta.template.call.cpp", "patterns": [ { - "include": "#storage_types-c" + "include": "#storage_types" }, { "include": "#constants" @@ -500,56 +700,56 @@ "include": "#operators" }, { - "include": "#numbers-c" + "include": "#number_literal" }, { "include": "#strings" }, { - "match": "(?-mix:,)", + "match": ",", "name": "punctuation.separator.comma.template.argument.cpp" } ] } } }, - "constants": { - "match": "((?,\\w])*>\\s*)?::)*)\\s*([a-zA-Z_]\\w*)\\s*(?:(<(?:[\\s<>,\\w])*>\\s*))?(::)", + "template_isolated_definition": { + "match": "(?\\s*$)", "captures": { "1": { - "name": "entity.scope.cpp", + "name": "storage.type.template.cpp" + }, + "2": { + "name": "punctuation.section.angle-brackets.start.template.definition.cpp" + }, + "3": { + "name": "meta.template.definition.cpp", "patterns": [ { "include": "#scope_resolution" - } - ] - }, - "2": { - "name": "entity.scope.name.cpp" - }, - "3": { - "patterns": [ + }, { - "include": "#template-call-innards" + "include": "#template_definition_argument" + }, + { + "include": "#template_argument_defaulted" + }, + { + "include": "#template_call_innards" + }, + { + "include": "$base" } ] }, "4": { - "name": "punctuation.separator.namespace.access.cpp" + "name": "punctuation.section.angle-brackets.end.template.definition.cpp" } } }, "template_definition": { - "begin": "(?-mix:(?", + "end": "(>)", "endCaptures": { - "0": { + "1": { "name": "punctuation.section.angle-brackets.end.template.definition.cpp" } }, - "name": "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": "#storage_types" + }, + { + "include": "#constants" + }, + { + "include": "#scope_resolution" + }, + { + "match": "(?))", + "match": "(?:(?:\\s*([a-zA-Z_]\\w*)|((?:[a-zA-Z_]\\w*\\s+)+)([a-zA-Z_]\\w*))|([a-zA-Z_]\\w*)\\s*(\\.\\.\\.)\\s*([a-zA-Z_]\\w*))\\s*(?:(,)|(?=>|$))", "captures": { "1": { "name": "storage.type.template.argument.$1.cpp" @@ -593,34 +854,511 @@ "name": "storage.type.template.cpp" }, "5": { - "name": "keyword.operator.ellipsis.template.definition.cpp" + "name": "punctuation.vararg-ellipses.template.definition.cpp" }, "6": { "name": "entity.name.type.template.cpp" }, "7": { - "name": "storage.type.template.cpp" - }, - "8": { - "name": "entity.name.type.template.cpp" - }, - "9": { - "name": "keyword.operator.assignment.cpp" - }, - "10": { - "name": "keyword.operator.assignment.cpp" - }, - "11": { - "name": "storage.type.template.argument.$10.cpp" - }, - "12": { - "name": "constant.language.cpp" - }, - "13": { "name": "punctuation.separator.comma.template.argument.cpp" } } }, + "scope_resolution": { + "match": "((?:[a-zA-Z_]\\w*\\s*(?:(?-mix:(?:<(?:[\\s<>,\\w])*>\\s*)))?::)*\\s*)([a-zA-Z_]\\w*)\\s*(?:(<(?:[\\s<>,\\w])*>\\s*))?(::)", + "captures": { + "1": { + "patterns": [ + { + "include": "#scope_resolution" + } + ] + }, + "2": { + "name": "entity.name.namespace.scope-resolution.cpp" + }, + "3": { + "name": "meta.template.call.cpp", + "patterns": [ + { + "include": "#storage_types" + }, + { + "include": "#constants" + }, + { + "include": "#scope_resolution" + }, + { + "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" + }, + { + "match": "=", + "name": "keyword.operator.assignment.cpp" + }, + { + "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": "#c_function_call" + }, + { + "include": "$base" + } + ] + } + ] + }, + "probably_a_parameter": { + "match": "(?:([a-zA-Z_]\\w*\\s*(?==))|((?<=\\w |\\*\\/|[&*>\\]\\)]|\\.\\.\\.)\\s*[a-zA-Z_]\\w*\\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_]\\w*\\s*(?:(?-mix:(?:<(?:[\\s<>,\\w])*>\\s*)))?::)*[a-zA-Z_]\\w*\\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.cpp" + } + }, + "end": "(\\))", + "endCaptures": { + "1": { + "name": "punctuation.section.parameters.end.bracket.round.cpp" + } + }, + "patterns": [ + { + "include": "#probably_a_parameter" + }, + { + "include": "#function-innards-c" + } + ] + }, + "member_access": { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*(\\b(?!(?:auto|void|char|short|int|signed|unsigned|long|float|double|bool|wchar_t|u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t))[a-zA-Z_]\\w*\\b(?!\\())", + "captures": { + "1": { + "name": "variable.other.object.access.cpp" + }, + "2": { + "name": "punctuation.separator.dot-access.cpp" + }, + "3": { + "name": "punctuation.separator.pointer-access.cpp" + }, + "4": { + "patterns": [ + { + "include": "#member_access" + }, + { + "include": "#method_access" + }, + { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", + "captures": { + "1": { + "name": "variable.other.object.access.cpp" + }, + "2": { + "name": "punctuation.separator.dot-access.cpp" + }, + "3": { + "name": "punctuation.separator.pointer-access.cpp" + } + } + } + ] + }, + "5": { + "name": "variable.other.member.cpp" + } + } + }, + "method_access": { + "contentName": "meta.function-call.member", + "begin": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))((?:[a-zA-Z_]\\w*\\s*(?-mix:(?:(?:\\.\\*|\\.))|(?:(?:->\\*|->)))\\s*)*)\\s*([a-zA-Z_]\\w*)(\\()", + "beginCaptures": { + "1": { + "name": "variable.other.object.access.cpp" + }, + "2": { + "name": "punctuation.separator.dot-access.cpp" + }, + "3": { + "name": "punctuation.separator.pointer-access.cpp" + }, + "4": { + "patterns": [ + { + "include": "#member_access" + }, + { + "include": "#method_access" + }, + { + "match": "((?:[a-zA-Z_]\\w*|(?<=\\]|\\)))\\s*)(?:((?:\\.\\*|\\.))|((?:->\\*|->)))", + "captures": { + "1": { + "name": "variable.other.object.access.cpp" + }, + "2": { + "name": "punctuation.separator.dot-access.cpp" + }, + "3": { + "name": "punctuation.separator.pointer-access.cpp" + } + } + } + ] + }, + "5": { + "name": "entity.name.function.member.cpp" + }, + "6": { + "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-innards-c" + } + ] + }, + "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" + } + ] + } + ] + }, "angle_brackets": { "begin": "<", "end": ">", @@ -714,14 +1452,14 @@ "special_block": { "patterns": [ { - "comment": "https://en.cppreference.com/w/cpp/language/namespace", - "begin": "\\b(using)\\s+(namespace)\\s+(?:((?:[a-zA-Z_]\\w*\\s*(?:<(?:[\\s<>,\\w])*>\\s*)?::)*)\\s*)?((?,\\w])*>\\s*)))?::)*\\s*))?((?,\\w])*>\\s*)?::)*[a-zA-Z_]\\w*)|(?={))", + "name": "meta.namespace-block.cpp", + "begin": "(?,\\w])*>\\s*)))?::)*\\s*)\\s*(?:((?|\\[|\\]|=))", - "name": "meta.namespace-block.cpp", + "end": "(?:(?<=\\})|(?=;|,|\\(|\\)|>|\\[|\\]|=))", "patterns": [ { - "begin": "\\{", + "begin": "(\\{)", "beginCaptures": { - "0": { + "1": { "name": "punctuation.definition.scope.cpp" } }, - "end": "\\}", + "end": "(\\})", "endCaptures": { - "0": { + "1": { "name": "punctuation.definition.scope.cpp" } }, @@ -795,47 +1530,65 @@ ] }, { - "begin": "\\b(?:(class)|(struct))\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+(\\s*:\\s*(public|protected|private)\\s*([_A-Za-z][_A-Za-z0-9]*\\b)((\\s*,\\s*(public|protected|private)\\s*[_A-Za-z][_A-Za-z0-9]*\\b)*))?", + "name": "meta.class-struct-block.cpp", + "begin": "(((?|\\[|\\]|=))", + "end": "(?:(?:(?<=\\})|(;))|(?=([()>\\[\\]=])))", "endCaptures": { "1": { "name": "punctuation.terminator.statement.cpp" } }, - "name": "meta.class-struct-block.cpp", "patterns": [ { "include": "#angle_brackets" }, + { + "match": ",", + "name": "punctuation.separator.delimiter.inhertance.cpp" + }, + { + "match": "(?:private|protected|public)", + "name": "storage.type.modifier.access.$0.cpp" + }, + { + "match": "(?<=private|protected|public|,|:)\\s*(?!(?:private|protected|public))((?\\]\\)]))\\s*([a-zA-Z_]\\w*)\\s*(?=(?:\\[\\]\\s*)?(?:,|\\))))", - "captures": { - "1": { - "name": "variable.parameter.probably.defaulted.cpp" - }, - "2": { - "name": "variable.parameter.probably.cpp" - } - } - }, - "operator_overload": { - "begin": "((?:[a-zA-Z_]\\w*\\s*(?:<(?:[\\s<>,\\w])*>\\s*)?::)*)\\s*(operator)((?:\\s*(?:\\+\\+|\\-\\-|\\(\\)|\\[\\]|\\->|\\+\\+|\\-\\-|\\+|\\-|!|~|\\*|&|\\->\\*|\\*|\\/|%|\\+|\\-|<<|>>|<=>|<|<=|>|>=|==|!=|&|\\^|\\||&&|\\|\\||=|\\+=|\\-=|\\*=|\\/=|%=|<<=|>>=|&=|\\^=|\\|=|,)|\\s+(?:(?:new|new\\[\\]|delete|delete\\[\\])|(?:[a-zA-Z_]\\w*\\s*(?:<(?:[\\s<>,\\w])*>\\s*)?::)*[a-zA-Z_]\\w*\\s*(?:&)?)))\\s*(\\()", - "beginCaptures": { - "1": { - "name": "entity.scope.cpp" - }, - "2": { - "name": "entity.name.operator.overload.cpp" - }, - "3": { - "name": "entity.name.operator.overloadee.cpp" - }, - "4": { - "name": "punctuation.section.parameters.begin.bracket.round.cpp" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.section.parameters.end.bracket.round.cpp" - } - }, - "name": "meta.function.definition.parameters.operator-overload.cpp", - "patterns": [ - { - "include": "#probably_a_parameter" - }, - { - "include": "#function-innards-c" - } - ] - }, - "access-method": { - "name": "meta.function-call.member.cpp", - "begin": "([a-zA-Z_][a-zA-Z_0-9]*|(?<=[\\]\\)]))\\s*(?:(\\.)|(->))((?:(?:[a-zA-Z_][a-zA-Z_0-9]*)\\s*(?:(?:\\.)|(?:->)))*)\\s*([a-zA-Z_][a-zA-Z_0-9]*)(\\()", - "beginCaptures": { - "1": { - "name": "variable.object.cpp" - }, - "2": { - "name": "punctuation.separator.dot-access.cpp" - }, - "3": { - "name": "punctuation.separator.pointer-access.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\.", - "name": "punctuation.separator.dot-access.cpp" - }, - { - "match": "->", - "name": "punctuation.separator.pointer-access.cpp" - }, - { - "match": "[a-zA-Z_][a-zA-Z_0-9]*", - "name": "variable.object.cpp" - }, - { - "name": "everything.else.cpp", - "match": ".+" - } - ] - }, - "5": { - "name": "entity.name.function.member.cpp" - }, - "6": { - "name": "punctuation.section.arguments.begin.bracket.round.function.member.cpp" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.section.arguments.end.bracket.round.function.member.cpp" - } - }, - "patterns": [ - { - "include": "#function-call-innards-c" - } - ] - }, - "access-member": { - "name": "variable.object.access.cpp", - "match": "(?:([a-zA-Z_]\\w*)|(?<=\\]|\\)))\\s*(?:((?:\\.|\\.\\*))|((?:->|->\\*)))\\s*((?:[a-zA-Z_]\\w*\\s*(?:\\.|->)\\s*)*)\\b(?!(?:auto|void|char|short|int|signed|unsigned|long|float|double|bool|wchar_t|u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|div_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t|pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t))([a-zA-Z_]\\w*)\\b(?!\\()", - "captures": { - "1": { - "name": "variable.object.cpp" - }, - "2": { - "name": "punctuation.separator.dot-access.cpp" - }, - "3": { - "name": "punctuation.separator.pointer-access.cpp" - }, - "4": { - "patterns": [ - { - "match": "\\.", - "name": "punctuation.separator.dot-access.cpp" - }, - { - "match": "->", - "name": "punctuation.separator.pointer-access.cpp" - }, - { - "match": "[a-zA-Z_]\\w*", - "name": "variable.object.cpp" - }, - { - "match": ".+", - "name": "everything.else.cpp" - } - ] - }, - "5": { - "name": "variable.other.member.cpp" - } - } - }, "block-c": { "patterns": [ { @@ -1144,10 +1764,10 @@ "include": "#preprocessor-rule-conditional-block" }, { - "include": "#access-method" + "include": "#method_access" }, { - "include": "#access-member" + "include": "#member_access" }, { "include": "#c_function_call" @@ -1203,7 +1823,7 @@ ] }, "c_function_call": { - "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|return|typeid|alignof|alignas|sizeof|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(?=\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*(?:<(?:[\\s<>,\\w])*>\\s*)?\\( # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", + "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|return|typeid|alignof|alignas|sizeof|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas|constexpr|volatile|operator|(?:::)?new|(?:::)?delete)\\s*\\()\n(?=\n(?:[A-Za-z_][A-Za-z0-9_]*+|::)++\\s*(?-mix:(?:(?-mix:(?:<(?:[\\s<>,\\w])*>\\s*)))?)\\( # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", "end": "(?<=\\))(?!\\w)", "name": "meta.function-call.cpp", "patterns": [ @@ -1238,10 +1858,6 @@ }, "name": "comment.block.cpp" }, - { - "match": "\\*/.*\\n", - "name": "invalid.illegal.stray-comment-end.cpp" - }, { "captures": { "1": { @@ -1303,38 +1919,8 @@ } ] }, - "numbers-c": { - "patterns": [ - { - "match": "\\b((?:0(?:x|X)[0-9a-fA-F](?:[0-9a-fA-F']*[0-9a-fA-F'])?|0(?:b|B)[01](?:[01']*[01'])?)(?:\\.[\\d+a-fA-F']+p[\\d']+)?|(([0-9](?:[0-9']*[0-9'])*(?:\\.[0-9](?:[0-9']*[0-9'])*)?)|(\\.[0-9](?:[0-9']*[0-9'])*))((e|E)(\\+|-)?[0-9](?:[0-9']*[0-9'])*)?)(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\w*", - "name": "constant.numeric.cpp", - "captures": { - "0": { - "patterns": [ - { - "match": "(?-mix:(?>=|\\|=", - "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" - }, - { - "match": "=", - "name": "keyword.operator.assignment.cpp" - }, - { - "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": "#access-method" - }, - { - "include": "#access-member" - }, - { - "include": "#c_function_call" - }, - { - "include": "$base" - } - ] - } - ] - }, - "strings-c": { + "strings_c": { "patterns": [ { "begin": "\"", @@ -1533,7 +2042,7 @@ }, { "match": "\\\\.", - "name": "invalid.illegal.1.unknown-escape.cpp" + "name": "invalid.illegal.unknown-escape.cpp" } ] }, @@ -1545,23 +2054,7 @@ } ] }, - "storage_types-c": { - "patterns": [ - { - "match": "(?:(?,\\w])*>\\s*)?) # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", + "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|return|typeid|alignof|alignas|sizeof|and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\s*\\()\n(\n(?:new)\\s*((?-mix:(?:(?-mix:(?:<(?:[\\s<>,\\w])*>\\s*)))?)) # actual name\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(\\()", "beginCaptures": { "1": { "name": "keyword.operator.memory.new.cpp" @@ -2747,7 +3240,7 @@ "2": { "patterns": [ { - "include": "#template-call-innards" + "include": "#template_call_innards" } ] }, @@ -2768,7 +3261,7 @@ ] }, { - "begin": "(?,\\w])*>\\s*)?::)*)\\s*([a-zA-Z_]\\w*)\\s*(?:(<(?:[\\s<>,\\w])*>\\s*))?(\\()", + "begin": "(?,\\w])*>\\s*)))?::)*\\s*)([a-zA-Z_]\\w*)\\s*(?:(<(?:[\\s<>,\\w])*>\\s*))?(\\()", "beginCaptures": { "1": { "patterns": [ @@ -2781,9 +3274,33 @@ "name": "entity.name.function.call.cpp" }, "3": { + "name": "meta.template.call.cpp", "patterns": [ { - "include": "#template-call-innards" + "include": "#storage_types" + }, + { + "include": "#constants" + }, + { + "include": "#scope_resolution" + }, + { + "match": "(?