From 8276711fd63e05cdb9c2a793df996cfb7cc347c8 Mon Sep 17 00:00:00 2001 From: chbk Date: Tue, 4 Aug 2020 15:20:56 +0200 Subject: [PATCH] Implement naming conventions --- grammars/tree-sitter-c.cson | 315 ++++++++++++++++-------- grammars/tree-sitter-cpp.cson | 442 +++++++++++++++++++++++----------- 2 files changed, 512 insertions(+), 245 deletions(-) diff --git a/grammars/tree-sitter-c.cson b/grammars/tree-sitter-c.cson index 455747b..8fbf1a0 100644 --- a/grammars/tree-sitter-c.cson +++ b/grammars/tree-sitter-c.cson @@ -59,12 +59,8 @@ comments: scopes: 'translation_unit': 'source.c' - 'comment': 'comment.block' - - 'identifier': [ - {match: '^[A-Z\\d_]+$', scopes: 'constant.other'} - ] + # Keyword '"#if"': 'keyword.control.directive' '"#ifdef"': 'keyword.control.directive' '"#ifndef"': 'keyword.control.directive' @@ -74,112 +70,227 @@ scopes: '"#define"': 'keyword.control.directive' '"#include"': 'keyword.control.directive' 'preproc_directive': 'keyword.control.directive' + '"__attribute__"': 'keyword.control.directive' + + '"if"': 'keyword.control.condition' + '"else"': 'keyword.control.condition' + '"switch"': 'keyword.control.condition' + '"case"': 'keyword.control.condition' + '"default"': 'keyword.control.condition' + '"do"': 'keyword.control.loop' + '"for"': 'keyword.control.loop' + '"while"': 'keyword.control.loop' + '"break"': 'keyword.control.jump' + '"continue"': 'keyword.control.jump' + '"return"': 'keyword.control.jump' + '"goto"': 'keyword.control.jump' + + '"sizeof"': 'keyword.operator.sizeof' + + '"+"': 'keyword.operator.arithmetic.symbolic' + '"-"': 'keyword.operator.arithmetic.symbolic' + 'binary_expression > "*"': 'keyword.operator.arithmetic.symbolic' + '"/"': 'keyword.operator.arithmetic.symbolic' + '"%"': 'keyword.operator.arithmetic.symbolic' + '"++"': 'keyword.operator.arithmetic.symbolic' + '"--"': 'keyword.operator.arithmetic.symbolic' + + 'binary_expression > "&"': 'keyword.operator.bitwise.symbolic' + '"|"': 'keyword.operator.bitwise.symbolic' + '"^"': 'keyword.operator.bitwise.symbolic' + '"~"': 'keyword.operator.bitwise.symbolic' + '"<<"': 'keyword.operator.bitwise.shift.symbolic' + '">>"': 'keyword.operator.bitwise.shift.symbolic' + + '"="': 'keyword.operator.assignment.symbolic' + '"+="': 'keyword.operator.assignment.compound.symbolic' + '"-="': 'keyword.operator.assignment.compound.symbolic' + '"*="': 'keyword.operator.assignment.compound.symbolic' + '"/="': 'keyword.operator.assignment.compound.symbolic' + '"%="': 'keyword.operator.assignment.compound.symbolic' + '"<<="': 'keyword.operator.assignment.compound.symbolic' + '">>="': 'keyword.operator.assignment.compound.symbolic' + '"&="': 'keyword.operator.assignment.compound.symbolic' + '"|="': 'keyword.operator.assignment.compound.symbolic' + '"^="': 'keyword.operator.assignment.compound.symbolic' + + '"=="': 'keyword.operator.comparison.symbolic' + '"!="': 'keyword.operator.comparison.symbolic' + '"<"': 'keyword.operator.comparison.symbolic' + '">"': 'keyword.operator.comparison.symbolic' + '"<="': 'keyword.operator.comparison.symbolic' + '">="': 'keyword.operator.comparison.symbolic' + + '"!"': 'keyword.operator.logical.symbolic' + '"&&"': 'keyword.operator.logical.symbolic' + '"||"': 'keyword.operator.logical.symbolic' + + '"&"': 'keyword.operator.pointer.reference.symbolic' + '"*"': 'keyword.operator.pointer.dereference.symbolic' - '"if"': 'keyword.control' - '"else"': 'keyword.control' - '"do"': 'keyword.control' - '"for"': 'keyword.control' - '"while"': 'keyword.control' - '"break"': 'keyword.control' - '"continue"': 'keyword.control' - '"return"': 'keyword.control' - '"switch"': 'keyword.control' - '"case"': 'keyword.control' - '"default"': 'keyword.control' - '"goto"': 'keyword.control' - - '"struct"': 'keyword.control' - '"enum"': 'keyword.control' - '"union"': 'keyword.control' - '"typedef"': 'keyword.control' - - 'preproc_function_def > identifier:nth-child(1)': 'entity.name.function.preprocessor' - 'preproc_arg': 'meta.preprocessor.macro' + '"?"': 'keyword.operator.ternary.symbolic' + 'conditional_expression > ":"': 'keyword.operator.ternary.symbolic' + + '"unsigned"': 'keyword.type.fundamental' + '"signed"': 'keyword.type.fundamental' + '"short"': 'keyword.type.fundamental' + '"long"': 'keyword.type.fundamental' + 'primitive_type': 'keyword.type.fundamental' + + '"typedef"': 'keyword.storage.declaration' + '"struct"': 'keyword.storage.declaration' + '"enum"': 'keyword.storage.declaration' + '"union"': 'keyword.storage.declaration' + + '"extern"': 'keyword.storage.modifier' + '"static"': 'keyword.storage.modifier' + '"register"': 'keyword.storage.modifier' + '"inline"': 'keyword.storage.modifier' + '"const"': 'keyword.storage.modifier' + '"volatile"': 'keyword.storage.modifier' + '"restrict"': 'keyword.storage.modifier' + '"_Atomic"': 'keyword.storage.modifier' + 'auto': 'keyword.storage.modifier' + 'function_specifier': 'keyword.storage.modifier' + + # Entity + 'type_identifier': 'entity.type' + + 'identifier': [ + { + match: '^[A-Z\\d_]+$', + scopes: 'entity.variable.immutable' + }, + 'entity.variable' + ] + + 'field_identifier': [ + { + match: '^[A-Z\\d_]+$', + scopes: 'entity.variable.member.immutable' + }, + 'entity.variable.member' + ] + + 'statement_identifier': 'entity.label' ''' - call_expression > identifier, - call_expression > field_expression > field_identifier, + preproc_function_def > identifier:nth-child(1), function_declarator > identifier - ''': 'entity.name.function' - - 'statement_identifier': 'constant.variable' + ''': 'entity.function' - 'field_identifier': 'variable.other.member' + ''' + call_expression > identifier, + call_expression > field_expression > field_identifier + ''': 'entity.function.call' - 'type_identifier': 'support.storage.type' - 'primitive_type': 'support.storage.type' - '"signed"': 'support.storage.type' - '"unsigned"': 'support.storage.type' - '"short"': 'support.storage.type' - '"long"': 'support.storage.type' + # String + 'string_literal': 'string.quoted' + 'system_lib_string': 'string.quoted' - 'char_literal': 'string.quoted.single' - 'string_literal': 'string.quoted.double' - 'system_lib_string': 'string.quoted.other' - 'escape_sequence': 'constant.character.escape' + # Constant + 'char_literal': 'constant.character' + 'escape_sequence': [ + { + match: '^\\\\[uUxftvnrabe0-9]', + scopes: 'constant.character.escape.code' + }, + 'constant.character.escape' + ] + 'preproc_include > string_literal > escape_sequence': '' # No escape characters in include directive 'number_literal': 'constant.numeric.decimal' + 'null': 'constant.language.null' - 'true': 'constant.language.boolean' - 'false': 'constant.language.boolean' - - 'auto': 'storage.modifier' - '"extern"': 'storage.modifier' - '"register"': 'storage.modifier' - '"static"': 'storage.modifier' - '"inline"': 'storage.modifier' - '"const"': 'storage.modifier' - '"volatile"': 'storage.modifier' - '"restrict"': 'storage.modifier' - '"_Atomic"': 'storage.modifier' - 'function_specifier': 'storage.modifier' - - '";"': 'punctuation.terminator.statement' - '"["': 'punctuation.definition.begin.bracket.square' - '"]"': 'punctuation.definition.end.bracket.square' - '","': 'punctuation.separator.delimiter' - 'char_literal > "\'"': 'punctuation.definition.string' + 'true': 'constant.language.boolean.true' + 'false': 'constant.language.boolean.false' + + # Comment + 'comment': 'comment.block' + + # Punctuation + '"."': 'punctuation.accessor.member' + '"->"': 'punctuation.accessor.member' + '";"': 'punctuation.delimiter.statement' + '":"': 'punctuation.delimiter' + '","': 'punctuation.delimiter' + '"("': 'punctuation.delimiter' + '")"': 'punctuation.delimiter' + '"{"': 'punctuation.delimiter' + '"}"': 'punctuation.delimiter' + '"["': 'punctuation.delimiter' + '"]"': 'punctuation.delimiter' + '"..."': 'punctuation.alteration.variadic' + 'char_literal > "\'"': 'punctuation.definition.constant.character' 'string_literal > "\\""': 'punctuation.definition.string' - '"{"': 'punctuation.section.block.begin.bracket.curly' - '"}"': 'punctuation.section.block.end.bracket.curly' - '"("': 'punctuation.section.parens.begin.bracket.round' - '")"': 'punctuation.section.parens.end.bracket.round' - '"sizeof"': 'keyword.operator.sizeof' - '"."': 'keyword.operator.member' - '"->"': 'keyword.operator.member' - '"*"': 'keyword.operator' - '"-"': 'keyword.operator' - '"+"': 'keyword.operator' - '"/"': 'keyword.operator' - '"%"': 'keyword.operator' - '"++"': 'keyword.operator' - '"--"': 'keyword.operator' - '"=="': 'keyword.operator' - '"!"': 'keyword.operator' - '"!="': 'keyword.operator' - '"<"': 'keyword.operator' - '">"': 'keyword.operator' - '">="': 'keyword.operator' - '"<="': 'keyword.operator' - '"&&"': 'keyword.operator' - '"||"': 'keyword.operator' - '"&"': 'keyword.operator' - '"|"': 'keyword.operator' - '"^"': 'keyword.operator' - '"~"': 'keyword.operator' - '"<<"': 'keyword.operator' - '">>"': 'keyword.operator' - '"="': 'keyword.operator' - '"+="': 'keyword.operator' - '"-="': 'keyword.operator' - '"*="': 'keyword.operator' - '"/="': 'keyword.operator' - '"%="': 'keyword.operator' - '"<<="': 'keyword.operator' - '">>="': 'keyword.operator' - '"&="': 'keyword.operator' - '"^="': 'keyword.operator' - '"|="': 'keyword.operator' - '"?"': 'keyword.operator' - '":"': 'keyword.operator' + 'array_declarator > "["': 'punctuation.delimiter.array.size' + 'array_declarator > "]"': 'punctuation.delimiter.array.size' + 'abstract_array_declarator > "["': 'punctuation.delimiter.array.size' + 'abstract_array_declarator > "]"': 'punctuation.delimiter.array.size' + + 'subscript_expression > "["': 'punctuation.accessor.subscript' + 'subscript_expression > "]"': 'punctuation.accessor.subscript' + 'subscript_designator > "["': 'punctuation.accessor.subscript' + 'subscript_designator > "]"': 'punctuation.accessor.subscript' + + 'initializer_list > "{"': 'punctuation.definition.collection' + 'initializer_list > "}"': 'punctuation.definition.collection' + + 'compound_statement > "{"': 'punctuation.delimiter.statement' + 'compound_statement > "}"': 'punctuation.delimiter.statement' + + 'function_definition > compound_statement > "{"': 'punctuation.delimiter.body.function' + 'function_definition > compound_statement > "}"': 'punctuation.delimiter.body.function' + + 'enumerator_list > "{"': 'punctuation.delimiter.body.enumeration' + 'enumerator_list > "}"': 'punctuation.delimiter.body.enumeration' + + 'union_specifier > field_declaration_list > "{"': 'punctuation.delimiter.body.union' + 'union_specifier > field_declaration_list > "}"': 'punctuation.delimiter.body.union' + + 'struct_specifier > field_declaration_list > "{"': 'punctuation.delimiter.body.structure' + 'struct_specifier > field_declaration_list > "}"': 'punctuation.delimiter.body.structure' + + 'preproc_params > "("': 'punctuation.delimiter.parameters' + 'preproc_params > ")"': 'punctuation.delimiter.parameters' + + 'parameter_list > "("': 'punctuation.delimiter.parameters' + 'parameter_list > ")"': 'punctuation.delimiter.parameters' + 'argument_list > "("': 'punctuation.delimiter.arguments' + 'argument_list > ")"': 'punctuation.delimiter.arguments' + + 'sizeof_expression > "("': 'punctuation.delimiter.arguments' + 'sizeof_expression > ")"': 'punctuation.delimiter.arguments' + 'sizeof_expression > parenthesized_expression > "("': 'punctuation.delimiter.arguments' + 'sizeof_expression > parenthesized_expression > ")"': 'punctuation.delimiter.arguments' + + 'attribute_specifier > "("': 'punctuation.delimiter.arguments' + 'attribute_specifier > ")"': 'punctuation.delimiter.arguments' + + 'cast_expression > "("': 'punctuation.delimiter.cast' + 'cast_expression > ")"': 'punctuation.delimiter.cast' + + 'compound_literal_expression > "("': 'punctuation.delimiter.expression' + 'compound_literal_expression > ")"': 'punctuation.delimiter.expression' + + 'parenthesized_expression > "("': 'punctuation.delimiter.expression' + 'parenthesized_expression > ")"': 'punctuation.delimiter.expression' + + 'for_statement > "("': 'punctuation.delimiter.expression' + 'for_statement > ")"': 'punctuation.delimiter.expression' + + 'ERROR > "."': 'punctuation.accessor.member.invalid.illegal' + 'ERROR > "->"': 'punctuation.accessor.member.invalid.illegal' + 'ERROR > ";"': 'punctuation.delimiter.statement.invalid.illegal' + 'ERROR > ":"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > ","': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "("': 'punctuation.delimiter.invalid.illegal' + 'ERROR > ")"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "{"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "}"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "["': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "]"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "..."': 'punctuation.alteration.variadic.invalid.illegal' + 'ERROR > "\'"': 'punctuation.definition.constant.character.invalid.illegal' + 'ERROR > "\\""': 'punctuation.definition.string.invalid.illegal' diff --git a/grammars/tree-sitter-cpp.cson b/grammars/tree-sitter-cpp.cson index d8fb0e4..2ae1345 100644 --- a/grammars/tree-sitter-cpp.cson +++ b/grammars/tree-sitter-cpp.cson @@ -75,12 +75,8 @@ comments: scopes: 'translation_unit': 'source.cpp' - 'comment': 'comment.block' - - 'identifier': [ - {match: '^[A-Z\\d_]+$', scopes: 'constant.other'} - ] + # Keyword '"#if"': 'keyword.control.directive' '"#ifdef"': 'keyword.control.directive' '"#ifndef"': 'keyword.control.directive' @@ -89,163 +85,323 @@ scopes: '"#endif"': 'keyword.control.directive' '"#define"': 'keyword.control.directive' '"#include"': 'keyword.control.directive' + '"using"': 'keyword.control.directive' 'preproc_directive': 'keyword.control.directive' + '"__attribute__"': 'keyword.control.directive' - '"if"': 'keyword.control' - '"else"': 'keyword.control' - '"do"': 'keyword.control' - '"for"': 'keyword.control' - '"while"': 'keyword.control' - '"break"': 'keyword.control' - '"continue"': 'keyword.control' - '"return"': 'keyword.control' - '"switch"': 'keyword.control' - '"case"': 'keyword.control' - '"default"': 'keyword.control' - '"goto"': 'keyword.control' - - '"struct"': 'keyword.control' - '"enum"': 'keyword.control' - '"union"': 'keyword.control' - '"typedef"': 'keyword.control' - '"class"': 'keyword.control' - '"using"': 'keyword.control' - '"namespace"': 'keyword.control' - '"template"': 'keyword.control' - '"typename"': 'keyword.control' - '"try"': 'keyword.control' - '"catch"': 'keyword.control' - '"throw"': 'keyword.control' - '"__attribute__"': 'keyword.attribute' - - 'preproc_function_def > identifier:nth-child(1)': 'entity.name.function.preprocessor' - 'preproc_arg': 'meta.preprocessor.macro' - 'preproc_directive': 'keyword.control.directive' + '"if"': 'keyword.control.condition' + '"else"': 'keyword.control.condition' + '"switch"': 'keyword.control.condition' + '"case"': 'keyword.control.condition' + '"default"': 'keyword.control.condition' + '"do"': 'keyword.control.loop' + '"for"': 'keyword.control.loop' + '"while"': 'keyword.control.loop' + '"break"': 'keyword.control.jump' + '"continue"': 'keyword.control.jump' + '"return"': 'keyword.control.jump' + '"goto"': 'keyword.control.jump' + '"try"': 'keyword.control.exception' + '"catch"': 'keyword.control.exception' + '"throw"': 'keyword.control.exception' + + '"sizeof"': 'keyword.operator.sizeof' + '"new"': 'keyword.operator.new' + '"delete"': 'keyword.operator.delete' + + 'template_function > identifier': { + match: '^(static|const|dynamic|reinterpret)_cast$', + scopes: 'keyword.operator.cast' + } + + '"+"': 'keyword.operator.arithmetic.symbolic' + '"-"': 'keyword.operator.arithmetic.symbolic' + 'binary_expression > "*"': 'keyword.operator.arithmetic.symbolic' + '"/"': 'keyword.operator.arithmetic.symbolic' + '"%"': 'keyword.operator.arithmetic.symbolic' + '"++"': 'keyword.operator.arithmetic.symbolic' + '"--"': 'keyword.operator.arithmetic.symbolic' + + 'binary_expression > "&"': 'keyword.operator.bitwise.symbolic' + '"|"': 'keyword.operator.bitwise.symbolic' + '"^"': 'keyword.operator.bitwise.symbolic' + '"~"': 'keyword.operator.bitwise.symbolic' + '"<<"': 'keyword.operator.bitwise.shift.symbolic' + '">>"': 'keyword.operator.bitwise.shift.symbolic' + + '"="': 'keyword.operator.assignment.symbolic' + '"+="': 'keyword.operator.assignment.compound.symbolic' + '"-="': 'keyword.operator.assignment.compound.symbolic' + '"*="': 'keyword.operator.assignment.compound.symbolic' + '"/="': 'keyword.operator.assignment.compound.symbolic' + '"%="': 'keyword.operator.assignment.compound.symbolic' + '"<<="': 'keyword.operator.assignment.compound.symbolic' + '">>="': 'keyword.operator.assignment.compound.symbolic' + '"&="': 'keyword.operator.assignment.compound.symbolic' + '"|="': 'keyword.operator.assignment.compound.symbolic' + '"^="': 'keyword.operator.assignment.compound.symbolic' + + '"=="': 'keyword.operator.comparison.symbolic' + '"!="': 'keyword.operator.comparison.symbolic' + 'relational_expression > "<"': 'keyword.operator.comparison.symbolic' + 'relational_expression > ">"': 'keyword.operator.comparison.symbolic' + '"<="': 'keyword.operator.comparison.symbolic' + '">="': 'keyword.operator.comparison.symbolic' + + '"!"': 'keyword.operator.logical.symbolic' + '"&&"': 'keyword.operator.logical.symbolic' + '"||"': 'keyword.operator.logical.symbolic' + + '"&"': 'keyword.operator.pointer.reference.symbolic' + '"*"': 'keyword.operator.pointer.dereference.symbolic' + + '"?"': 'keyword.operator.ternary.symbolic' + 'conditional_expression > ":"': 'keyword.operator.ternary.symbolic' + + 'operator_name': 'keyword.operator.symbolic' + + '"unsigned"': 'keyword.type.fundamental' + '"signed"': 'keyword.type.fundamental' + '"short"': 'keyword.type.fundamental' + '"long"': 'keyword.type.fundamental' + 'primitive_type': 'keyword.type.fundamental' + + '"typedef"': 'keyword.storage.declaration' + '"struct"': 'keyword.storage.declaration' + '"enum"': 'keyword.storage.declaration' + '"union"': 'keyword.storage.declaration' + '"class"': 'keyword.storage.declaration' + '"template"': 'keyword.storage.declaration' + '"typename"': 'keyword.storage.declaration' + '"namespace"': 'keyword.storage.declaration' + 'auto': 'keyword.storage.declaration' - 'template_function > identifier': [ + '"extern"': 'keyword.storage.modifier' + '"static"': 'keyword.storage.modifier' + '"register"': 'keyword.storage.modifier' + '"friend"': 'keyword.storage.modifier' + '"inline"': 'keyword.storage.modifier' + '"explicit"': 'keyword.storage.modifier' + '"const"': 'keyword.storage.modifier' + '"constexpr"': 'keyword.storage.modifier' + '"volatile"': 'keyword.storage.modifier' + '"restrict"': 'keyword.storage.modifier' + '"public"': 'keyword.storage.modifier' + '"private"': 'keyword.storage.modifier' + '"protected"': 'keyword.storage.modifier' + '"final"': 'keyword.storage.modifier' + '"override"': 'keyword.storage.modifier' + '"virtual"': 'keyword.storage.modifier' + '"noexcept"': 'keyword.storage.modifier' + '"mutable"': 'keyword.storage.modifier' + + # Entity + 'type_identifier': 'entity.type' + + 'identifier': [ { - match: '^(static|const|dynamic|reinterpret)_cast$' - scopes: 'keyword.operator' - } + match: '^[A-Z\\d_]+$', + scopes: 'entity.variable.immutable' + }, + { + exact: 'this', + scopes: 'keyword.variable.this' + }, + 'entity.variable' ] + 'field_identifier': [ + { + match: '^[A-Z\\d_]+$', + scopes: 'entity.variable.member.immutable' + }, + 'entity.variable.member' + ] + + 'namespace_identifier': 'entity.namespace' + + 'statement_identifier': 'entity.label' + ''' - call_expression > identifier, - call_expression > field_expression > field_identifier, - call_expression > scoped_identifier > identifier, + preproc_function_def > identifier:nth-child(1), template_function > identifier, template_function > scoped_identifier > identifier, - template_method > field_identifier, function_declarator > identifier, - function_declarator > field_identifier, function_declarator > scoped_identifier > identifier, destructor_name > identifier - ''': 'entity.name.function' + ''': 'entity.function' - 'statement_identifier': 'constant.variable' + ''' + template_method > field_identifier, + function_declarator > field_identifier, + ''': 'entity.function.method' - 'field_identifier': 'variable.other.member' + ''' + call_expression > identifier, + call_expression > scoped_identifier > identifier + ''': 'entity.function.call' - 'type_identifier': 'support.storage.type' - 'primitive_type': 'support.storage.type' - '"unsigned"': 'support.storage.type' - '"signed"': 'support.storage.type' - '"short"': 'support.storage.type' - '"long"': 'support.storage.type' - 'auto': 'support.storage.type' + 'call_expression > field_expression > field_identifier': 'entity.function.method.call' - 'char_literal': 'string.quoted.single' - 'string_literal': 'string.quoted.double' - 'system_lib_string': 'string.quoted.other' - 'raw_string_literal': 'string.quoted.other' - 'escape_sequence': 'constant.character.escape' - 'preproc_include > string_literal > escape_sequence': 'string.quoted.double' + # String + 'string_literal': 'string.quoted' + 'system_lib_string': 'string.quoted' + 'raw_string_literal': 'string.quoted' + + # Constant + 'char_literal': 'constant.character' + 'escape_sequence': [ + { + match: '^\\\\[uUxftvnrabe0-9]', + scopes: 'constant.character.escape.code' + }, + 'constant.character.escape' + ] + 'preproc_include > string_literal > escape_sequence': '' # No escape characters in include directive 'number_literal': 'constant.numeric.decimal' + 'null': 'constant.language.null' 'nullptr': 'constant.language.null' - 'true': 'constant.language.boolean' - 'false': 'constant.language.boolean' - - '"extern"': 'storage.modifier' - '"static"': 'storage.modifier' - '"register"': 'storage.modifier' - '"friend"': 'storage.modifier' - '"inline"': 'storage.modifier' - '"explicit"': 'storage.modifier' - '"const"': 'storage.modifier' - '"constexpr"': 'storage.modifier' - '"volatile"': 'storage.modifier' - '"restrict"': 'storage.modifier' - 'function_specifier': 'storage.modifier' - '"public"': 'storage.modifier' - '"private"': 'storage.modifier' - '"protected"': 'storage.modifier' - '"final"': 'storage.modifier' - '"override"': 'storage.modifier' - '"virtual"': 'storage.modifier' - '"noexcept"': 'storage.modifier' - '"mutable"': 'storage.modifier' - - '";"': 'punctuation.terminator.statement' - '"["': 'punctuation.definition.begin.bracket.square' - '"]"': 'punctuation.definition.end.bracket.square' - 'access_specifier > ":"': 'punctuation.definition.visibility.colon' - 'base_class_clause > ":"': 'punctuation.definition.inheritance.colon' - 'base_class_clause > ","': 'punctuation.definition.separator.class.comma' - 'field_declaration > ","': 'punctuation.separator.delimiter' - 'parameter_list > ","': 'punctuation.separator.delimiter' - 'field_initializer_list > ":"': 'punctuation.definition.initialization.colon' - 'field_initializer_list > ","': 'punctuation.separator.delimiter' - '"::"': 'punctuation.separator.method.double-colon' - 'template_parameter_list > "<"': 'punctuation.definition.template.bracket.angle' - 'template_parameter_list > ">"': 'punctuation.definition.template.bracket.angle' - 'template_argument_list > ">"': 'punctuation.definition.template.bracket.angle' - 'template_argument_list > "<"': 'punctuation.definition.template.bracket.angle' - 'char_literal > "\'"': 'punctuation.definition.string' + 'true': 'constant.language.boolean.true' + 'false': 'constant.language.boolean.false' + + # Comment + 'comment': 'comment.block' + + # Punctuation + '"."': 'punctuation.accessor.member' + '"->"': 'punctuation.accessor.member' + '"::"': 'punctuation.accessor.scope' + '";"': 'punctuation.delimiter.statement' + '":"': 'punctuation.delimiter' + '","': 'punctuation.delimiter' + '"("': 'punctuation.delimiter' + '")"': 'punctuation.delimiter' + '"{"': 'punctuation.delimiter' + '"}"': 'punctuation.delimiter' + '"["': 'punctuation.delimiter' + '"]"': 'punctuation.delimiter' + '"..."': 'punctuation.alteration.variadic' + 'char_literal > "\'"': 'punctuation.definition.constant.character' 'string_literal > "\\""': 'punctuation.definition.string' - '"{"': 'punctuation.section.block.begin.bracket.curly' - '"}"': 'punctuation.section.block.end.bracket.curly' - '"("': 'punctuation.section.parens.begin.bracket.round' - '")"': 'punctuation.section.parens.end.bracket.round' - '"sizeof"': 'keyword.operator.sizeof' - '"new"': 'keyword.operator' - '"delete"': 'keyword.operator' - '"."': 'keyword.operator.member' - '"->"': 'keyword.operator.member' - '"*"': 'keyword.operator' - '"-"': 'keyword.operator' - '"+"': 'keyword.operator' - '"/"': 'keyword.operator' - '"%"': 'keyword.operator' - '"++"': 'keyword.operator' - '"--"': 'keyword.operator' - '"=="': 'keyword.operator' - '"!"': 'keyword.operator' - '"!="': 'keyword.operator' - 'relational_expression > "<"': 'keyword.operator' - 'relational_expression > ">"': 'keyword.operator' - '">="': 'keyword.operator' - '"<="': 'keyword.operator' - '"&&"': 'keyword.operator' - '"||"': 'keyword.operator' - '"&"': 'keyword.operator' - '"|"': 'keyword.operator' - '"^"': 'keyword.operator' - '"~"': 'keyword.operator' - '"<<"': 'keyword.operator' - '">>"': 'keyword.operator' - '"="': 'keyword.operator' - '"+="': 'keyword.operator' - '"-="': 'keyword.operator' - '"*="': 'keyword.operator' - '"/="': 'keyword.operator' - '"%="': 'keyword.operator' - '"<<="': 'keyword.operator' - '">>="': 'keyword.operator' - '"&="': 'keyword.operator' - '"^="': 'keyword.operator' - '"|="': 'keyword.operator' - '"?"': 'keyword.operator' - 'conditional_expression > ":"': 'keyword.operator' + 'trailing_return_type > "->"': 'punctuation.delimiter.type.return' + 'base_class_clause > ":"': 'punctuation.delimiter.type' + 'enum_specifier > ":"': 'punctuation.delimiter.type' + + 'structured_binding_declarator > "["': 'punctuation.delimiter.binding' + 'structured_binding_declarator > "["': 'punctuation.delimiter.binding' + + 'lambda_capture_specifier > "["': 'punctuation.delimiter.capture' + 'lambda_capture_specifier > "]"': 'punctuation.delimiter.capture' + + 'array_declarator > "["': 'punctuation.delimiter.array.size' + 'array_declarator > "]"': 'punctuation.delimiter.array.size' + 'abstract_array_declarator > "["': 'punctuation.delimiter.array.size' + 'abstract_array_declarator > "]"': 'punctuation.delimiter.array.size' + 'new_declarator > "["': 'punctuation.delimiter.array.size' + 'new_declarator > "]"': 'punctuation.delimiter.array.size' + + 'delete_expression > "["': 'punctuation.alteration.delete.array' + 'delete_expression > "]"': 'punctuation.alteration.delete.array' + + 'subscript_expression > "["': 'punctuation.accessor.subscript' + 'subscript_expression > "]"': 'punctuation.accessor.subscript' + 'subscript_designator > "["': 'punctuation.accessor.subscript' + 'subscript_designator > "]"': 'punctuation.accessor.subscript' + + 'initializer_list > "{"': 'punctuation.definition.collection' + 'initializer_list > "}"': 'punctuation.definition.collection' + + 'compound_statement > "{"': 'punctuation.delimiter.statement' + 'compound_statement > "}"': 'punctuation.delimiter.statement' + + 'function_definition > compound_statement > "{"': 'punctuation.delimiter.body.function' + 'function_definition > compound_statement > "}"': 'punctuation.delimiter.body.function' + 'lambda_expression > compound_statement > "{"': 'punctuation.delimiter.body.function.lambda' + 'lambda_expression > compound_statement > "}"': 'punctuation.delimiter.body.function.lambda' + + 'enumerator_list > "{"': 'punctuation.delimiter.body.enumeration' + 'enumerator_list > "}"': 'punctuation.delimiter.body.enumeration' + + 'union_specifier > field_declaration_list > "{"': 'punctuation.delimiter.body.union' + 'union_specifier > field_declaration_list > "}"': 'punctuation.delimiter.body.union' + + 'struct_specifier > field_declaration_list > "{"': 'punctuation.delimiter.body.structure' + 'struct_specifier > field_declaration_list > "}"': 'punctuation.delimiter.body.structure' + + 'class_specifier > field_declaration_list > "{"': 'punctuation.delimiter.body.class' + 'class_specifier > field_declaration_list > "}"': 'punctuation.delimiter.body.class' + + 'namespace_definition > declaration_list > "{"': 'punctuation.delimiter.body.namespace' + 'namespace_definition > declaration_list > "}"': 'punctuation.delimiter.body.namespace' + + 'linkage_specification > declaration_list > "{"': 'punctuation.delimiter.linkage' + 'linkage_specification > declaration_list > "}"': 'punctuation.delimiter.linkage' + + 'template_parameter_list > "<"': 'punctuation.delimiter.parameters.template' + 'template_parameter_list > ">"': 'punctuation.delimiter.parameters.template' + 'template_argument_list > ">"': 'punctuation.delimiter.arguments.template' + 'template_argument_list > "<"': 'punctuation.delimiter.arguments.template' + + 'preproc_params > "("': 'punctuation.delimiter.parameters' + 'preproc_params > ")"': 'punctuation.delimiter.parameters' + + 'parameter_list > "("': 'punctuation.delimiter.parameters' + 'parameter_list > ")"': 'punctuation.delimiter.parameters' + 'argument_list > "("': 'punctuation.delimiter.arguments' + 'argument_list > ")"': 'punctuation.delimiter.arguments' + + 'sizeof_expression > "("': 'punctuation.delimiter.arguments' + 'sizeof_expression > ")"': 'punctuation.delimiter.arguments' + 'sizeof_expression > parenthesized_expression > "("': 'punctuation.delimiter.arguments' + 'sizeof_expression > parenthesized_expression > ")"': 'punctuation.delimiter.arguments' + + 'throw_specifier > "("': 'punctuation.delimiter.arguments' + 'throw_specifier > ")"': 'punctuation.delimiter.arguments' + + 'attribute_specifier > "("': 'punctuation.delimiter.arguments' + 'attribute_specifier > ")"': 'punctuation.delimiter.arguments' + + 'static_assert_declaration > "("': 'punctuation.delimiter.arguments' + 'static_assert_declaration > ")"': 'punctuation.delimiter.arguments' + + 'cast_expression > "("': 'punctuation.delimiter.cast' + 'cast_expression > ")"': 'punctuation.delimiter.cast' + + 'compound_literal_expression > "("': 'punctuation.delimiter.expression' + 'compound_literal_expression > ")"': 'punctuation.delimiter.expression' + + 'parenthesized_expression > "("': 'punctuation.delimiter.expression' + 'parenthesized_expression > ")"': 'punctuation.delimiter.expression' + + 'for_statement > "("': 'punctuation.delimiter.expression' + 'for_statement > ")"': 'punctuation.delimiter.expression' + + 'for_range_loop > "("': 'punctuation.delimiter.expression' + 'for_range_loop > ")"': 'punctuation.delimiter.expression' + + 'noexcept > "("': 'punctuation.delimiter.expression' + 'noexcept > ")"': 'punctuation.delimiter.expression' + + 'condition_clause > "("': 'punctuation.delimiter.expression' + 'condition_clause > ")"': 'punctuation.delimiter.expression' + + 'ERROR > "."': 'punctuation.accessor.member.invalid.illegal' + 'ERROR > "->"': 'punctuation.accessor.member.invalid.illegal' + 'ERROR > "::"': 'punctuation.accessor.scope.invalid.illegal' + 'ERROR > ";"': 'punctuation.delimiter.statement.invalid.illegal' + 'ERROR > ":"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "<"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > ">"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > ","': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "("': 'punctuation.delimiter.invalid.illegal' + 'ERROR > ")"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "{"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "}"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "["': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "]"': 'punctuation.delimiter.invalid.illegal' + 'ERROR > "..."': 'punctuation.alteration.variadic.invalid.illegal' + 'ERROR > "\'"': 'punctuation.definition.constant.character.invalid.illegal' + 'ERROR > "\\""': 'punctuation.definition.string.invalid.illegal'