site/node_modules/shiki/dist/langs/cpp.mjs

36 lines
434 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
import cpp_macro from './cpp-macro.mjs';
import glsl from './glsl.mjs';
import sql from './sql.mjs';
import './c.mjs';
const lang = Object.freeze({ "displayName": "C++", "name": "cpp", "patterns": [{ "include": "#ever_present_context" }, { "include": "#constructor_root" }, { "include": "#destructor_root" }, { "include": "#function_definition" }, { "include": "#operator_overload" }, { "include": "#using_namespace" }, { "include": "#type_alias" }, { "include": "#using_name" }, { "include": "#namespace_alias" }, { "include": "#namespace_block" }, { "include": "#extern_block" }, { "include": "#typedef_class" }, { "include": "#typedef_struct" }, { "include": "#typedef_union" }, { "include": "#misc_keywords" }, { "include": "#standard_declares" }, { "include": "#class_block" }, { "include": "#struct_block" }, { "include": "#union_block" }, { "include": "#enum_block" }, { "include": "#template_isolated_definition" }, { "include": "#template_definition" }, { "include": "#template_explicit_instantiation" }, { "include": "#access_control_keywords" }, { "include": "#block" }, { "include": "#static_assert" }, { "include": "#assembly" }, { "include": "#function_pointer" }, { "include": "#evaluation_context" }], "repository": { "access_control_keywords": { "captures": { "1": { "patterns": [{ "include": "#inline_comment" }] }, "2": { "patterns": [{ "captures": { "1": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "2": { "name": "comment.block.cpp" }, "3": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" } }, "match": "\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+" }] }, "3": { "name": "storage.type.modifier.access.control.$4.cpp" }, "4": {}, "5": { "name": "punctuation.separator.colon.access.control.cpp" } }, "match": "((?:((?:\\s*+\\/\\*(?:[^\\*]++|\\*+(?!\\/))*+\\*\\/\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(((?:(?:protected)|(?:private)|(?:public)))(?:\\s+)?(:))" }, "alignas_attribute": { "begin": "alignas\\(", "beginCaptures": { "0": { "name": "punctuation.section.attribute.begin.cpp" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.attribute.end.cpp" } }, "name": "support.other.attribute.cpp", "patterns": [{ "include": "#attributes_context" }, { "begin": "\\(", "beginCaptures": {}, "end": "\\)", "endCaptures": {}, "patterns": [{ "include": "#attributes_context" }, { "include": "#string_context" }, { "include": "#ever_present_context" }] }, { "captures": { "1": { "name": "keyword.other.using.directive.cpp" }, "2": { "name": "entity.name.namespace.cpp" } }, "match": "(using)\\s+((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?!\\w))" }, { "match": ",", "name": "punctuation.separator.attribute.cpp" }, { "match": ":", "name": "punctuation.accessor.attribute.cpp" }, { "match": "(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?!\\w)(?=::)", "name": "entity.name.namespace.cpp" }, { "match": "(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?!\\w)", "name": "entity.other.attribute.$0.cpp" }, { "include": "#number_literal" }, { "include": "#ever_present_context" }] }, "alignas_operator": { "begin": "((?<!\\w)alignas(?!\\w))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(\\()", "beginCaptures": { "1": { "name": "keyword.operator.functionlike.cpp keyword.operator.alignas.cpp" }, "2": { "patterns": [{ "include": "#inline_comment" }] }, "3": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "4": { "name": "comment.block.cpp" }, "5": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, "6": { "name": "punctuation.section.arguments.begin.bracket.round.operator.alignas.cpp" } }, "contentName": "meta.arguments.operator.alignas", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.arguments.end.bracket.round.operator.alignas.cpp" } }, "patterns": [{ "include": "#evaluation_context" }] }, "alignof_operator": { "beg
\\\\ |
[abefnprtv'"?] |
[0-3][0-7]{,2} |
[4-7]\\d? |
x[a-fA-F0-9]{,2} |
u[a-fA-F0-9]{,4} |
U[a-fA-F0-9]{,8} )`, "name": "constant.character.escape" }, "block": { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.section.block.begin.bracket.curly.cpp" } }, "end": "}", "endCaptures": { "0": { "name": "punctuation.section.block.end.bracket.curly.cpp" } }, "name": "meta.block.cpp", "patterns": [{ "include": "#function_body_context" }] }, "block_comment": { "begin": "\\s*+(\\/\\*)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.begin.cpp" } }, "end": "\\*\\/", "endCaptures": { "0": { "name": "punctuation.definition.comment.end.cpp" } }, "name": "comment.block.cpp" }, "builtin_storage_type_initilizer": { "begin": "\\s*+(?<!\\w)(?:(?:(?:((?:(?:unsigned)|(?:wchar_t)|(?:double)|(?:signed)|(?:short)|(?:float)|(?:auto)|(?:void)|(?:long)|(?:char)|(?:bool)|(?:int)))|((?:(?:uint_least32_t)|(?:uint_least64_t)|(?:uint_least16_t)|(?:uint_fast64_t)|(?:uint_least8_t)|(?:int_least64_t)|(?:int_least32_t)|(?:int_least16_t)|(?:uint_fast16_t)|(?:uint_fast32_t)|(?:int_least8_t)|(?:int_fast16_t)|(?:int_fast32_t)|(?:int_fast64_t)|(?:uint_fast8_t)|(?:int_fast8_t)|(?:suseconds_t)|(?:useconds_t)|(?:uintmax_t)|(?:uintmax_t)|(?:in_port_t)|(?:uintmax_t)|(?:in_addr_t)|(?:blksize_t)|(?:uintptr_t)|(?:intmax_t)|(?:intptr_t)|(?:blkcnt_t)|(?:intmax_t)|(?:u_quad_t)|(?:uint16_t)|(?:uint32_t)|(?:uint64_t)|(?:ssize_t)|(?:fixpt_t)|(?:qaddr_t)|(?:u_short)|(?:int16_t)|(?:int32_t)|(?:int64_t)|(?:uint8_t)|(?:daddr_t)|(?:caddr_t)|(?:swblk_t)|(?:clock_t)|(?:segsz_t)|(?:nlink_t)|(?:time_t)|(?:u_long)|(?:ushort)|(?:quad_t)|(?:mode_t)|(?:size_t)|(?:u_char)|(?:int8_t)|(?:u_int)|(?:uid_t)|(?:off_t)|(?:pid_t)|(?:gid_t)|(?:dev_t)|(?:div_t)|(?:key_t)|(?:ino_t)|(?:id_t)|(?:id_t)|(?:uint))))|((?:(?:pthread_rwlockattr_t)|(?:pthread_mutexattr_t)|(?:pthread_condattr_t)|(?:pthread_rwlock_t)|(?:pthread_mutex_t)|(?:pthread_cond_t)|(?:pthread_attr_t)|(?:pthread_once_t)|(?:pthread_key_t)|(?:pthread_t))))|([a-zA-Z_]\\w*_t))(?!\\w)\\s*+(?<!\\w)(\\()", "beginCaptures": { "1": { "name": "storage.type.primitive.cpp storage.type.built-in.primitive.cpp" }, "2": { "name": "storage.type.cpp storage.type.built-in.cpp" }, "3": { "name": "support.type.posix-reserved.pthread.cpp support.type.built-in.posix-reserved.pthread.cpp" }, "4": { "name": "support.type.posix-reserved.cpp support.type.built-in.posix-reserved.cpp" }, "5": { "name": "punctuation.section.arguments.begin.bracket.round.initializer.cpp" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.arguments.end.bracket.round.initializer.cpp" } }, "patterns": [{ "include": "#evaluation_context" }] }, "case_statement": { "begin": "((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))((?<!\\w)case(?!\\w))", "beginCaptures": { "1": { "patterns": [{ "include": "#inline_comment" }] }, "2": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "3": { "name": "comment.block.cpp" }, "4": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, "5": { "name": "keyword.control.case.cpp" } }, "end": ":", "endCaptures": { "0": { "name": "punctuation.separator.colon.case.cpp" } }, "name": "meta.conditional.case.cpp", "patterns": [{ "include": "#evaluation_context" }] }, "class_block": { "begin": "((?<!\\w)class(?!\\w))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?={)|(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?((?:(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?!\\w)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*+)?(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(:(?!:)))?)", "beginCaptures": { "0": { "name": "meta.
\\\\ |
[abefnprtv'"?] |
[0-3][0-7]{,2} |
[4-7]\\d? |
x[a-fA-F0-9]{,2} |
u[a-fA-F0-9]{,4} |
U[a-fA-F0-9]{,8} )`, "name": "constant.character.escape" }, { "match": "\\\\.", "name": "invalid.illegal.unknown-escape" }, { "match": `(?x) (?!%')(?!%")%
(\\d+\\$)?
[#0\\- +']*
[,;:_]?
((-?\\d+)|\\*(-?\\d+\\$)?)?
(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)?
(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?
[diouxXDOUeEfFgGaACcSspn%]`, "name": "constant.other.placeholder" }] }, "struct_block": { "begin": "((?<!\\w)struct(?!\\w))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:(?={)|(?:((?:(?:(?:\\[\\[.*?\\]\\]|__attribute(?:__)?\\s*\\(\\s*\\(.*?\\)\\s*\\))|__declspec\\(.*?\\))|alignas\\(.*?\\))(?!\\)))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?((?:(?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?!\\w)((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))*+)?(?:((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(:(?!:)))?)", "beginCaptures": { "0": { "name": "meta.head.struct.cpp" }, "1": { "name": "storage.type.$1.cpp" }, "2": { "patterns": [{ "include": "#inline_comment" }] }, "3": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "4": { "name": "comment.block.cpp" }, "5": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, "6": { "patterns": [{ "include": "#attributes_context" }, { "include": "#number_literal" }] }, "7": { "patterns": [{ "include": "#inline_comment" }] }, "8": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "9": { "name": "comment.block.cpp" }, "10": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, "11": { "patterns": [{ "captures": { "1": { "name": "storage.type.modifier.final.cpp" }, "2": { "patterns": [{ "include": "#inline_comment" }] }, "3": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "4": { "name": "comment.block.cpp" }, "5": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" } }, "match": "((?<!\\w)final(?!\\w))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))" }, { "captures": { "1": { "name": "entity.name.type.struct.cpp" }, "2": { "patterns": [{ "include": "#inline_comment" }] }, "3": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "4": { "name": "comment.block.cpp" }, "5": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, "6": { "name": "storage.type.modifier.final.cpp" }, "7": { "patterns": [{ "include": "#inline_comment" }] }, "8": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "9": { "name": "comment.block.cpp" }, "10": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" } }, "match": "((?<!\\w)(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*(?!\\w))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z))(?:((?<!\\w)final(?!\\w))((?:(?:(?:\\s*+(\\/\\*)((?:[^\\*]++|\\*+(?!\\/))*+(\\*\\/))\\s*+)+)|(?:\\s++)|(?<=\\W)|(?=\\W)|^|(?:\\n?$)|\\A|\\Z)))?(?=:|{|$)" }, { "match": "DLLEXPORT", "name": "entity.name.other.preprocessor.macro.predefined.DLLEXPORT.cpp" }, { "match": "(?:[a-zA-Z_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))(?:[a-zA-Z0-9_]|(?:\\\\u[0-9a-fA-F]{4}|\\\\U[0-9a-fA-F]{8}))*", "name": "entity.name.other.preprocessor.macro.predefined.probably.$0.cpp" }] }, "12": { "patterns": [{ "include": "#inline_comment" }] }, "13": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "14": { "name": "comment.block.cpp" }, "15": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, "16": { "patterns": [{ "include": "#inline_comment" }] }, "17": { "name": "comment.block.cpp punctuation.definition.comment.begin.cpp" }, "18": { "name": "comment.block.cpp" }, "19": { "name": "comment.block.cpp punctuation.definition.comment.end.cpp" }, "20": { "name": "punctuation.separator.colon.inheritance.cpp" } }, "end": "(?:(?:(?<=\\}|%>|\\?\\?>)(?:\\s+)?(;)|(;))|(?=[;>\\[\\]=]))", "endCaptures": { "1": { "
var cpp = [
...cpp_macro,
...glsl,
...sql,
lang
];
export { cpp as default };