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

21 lines
75 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "C", "name": "c", "patterns": [{ "include": "#preprocessor-rule-enabled" }, { "include": "#preprocessor-rule-disabled" }, { "include": "#preprocessor-rule-conditional" }, { "include": "#predefined_macros" }, { "include": "#comments" }, { "include": "#switch_statement" }, { "include": "#anon_pattern_1" }, { "include": "#storage_types" }, { "include": "#anon_pattern_2" }, { "include": "#anon_pattern_3" }, { "include": "#anon_pattern_4" }, { "include": "#anon_pattern_5" }, { "include": "#anon_pattern_6" }, { "include": "#anon_pattern_7" }, { "include": "#operators" }, { "include": "#numbers" }, { "include": "#strings" }, { "include": "#anon_pattern_range_1" }, { "include": "#anon_pattern_range_2" }, { "include": "#anon_pattern_range_3" }, { "include": "#pragma-mark" }, { "include": "#anon_pattern_range_4" }, { "include": "#anon_pattern_range_5" }, { "include": "#anon_pattern_range_6" }, { "include": "#anon_pattern_8" }, { "include": "#anon_pattern_9" }, { "include": "#anon_pattern_10" }, { "include": "#anon_pattern_11" }, { "include": "#anon_pattern_12" }, { "include": "#anon_pattern_13" }, { "include": "#block" }, { "include": "#parens" }, { "include": "#anon_pattern_range_7" }, { "include": "#line_continuation_character" }, { "include": "#anon_pattern_range_8" }, { "include": "#anon_pattern_range_9" }, { "include": "#anon_pattern_14" }, { "include": "#anon_pattern_15" }], "repository": { "access-method": { "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.c" }, "2": { "name": "punctuation.separator.dot-access.c" }, "3": { "name": "punctuation.separator.pointer-access.c" }, "4": { "patterns": [{ "match": "\\.", "name": "punctuation.separator.dot-access.c" }, { "match": "->", "name": "punctuation.separator.pointer-access.c" }, { "match": "[a-zA-Z_][a-zA-Z_0-9]*", "name": "variable.object.c" }, { "match": ".+", "name": "everything.else.c" }] }, "5": { "name": "entity.name.function.member.c" }, "6": { "name": "punctuation.section.arguments.begin.bracket.round.function.member.c" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.arguments.end.bracket.round.function.member.c" } }, "name": "meta.function-call.member.c", "patterns": [{ "include": "#function-call-innards" }] }, "anon_pattern_1": { "match": "\\b(break|continue|do|else|for|goto|if|_Pragma|return|while)\\b", "name": "keyword.control.c" }, "anon_pattern_10": { "match": "(?x) \\b\n(int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t\n|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t\n|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t\n|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t\n|uintmax_t|uintmax_t)\n\\b", "name": "support.type.stdint.c" }, "anon_pattern_11": { "match": "\\b(noErr|kNilOptions|kInvalidID|kVariableLengthArray)\\b", "name": "support.constant.mac-classic.c" }, "anon_pattern_12": { "match": "(?x) \\b\n(AbsoluteTime|Boolean|Byte|ByteCount|ByteOffset|BytePtr|CompTimeValue|ConstLogicalAddress|ConstStrFileNameParam\n|ConstStringPtr|Duration|Fixed|FixedPtr|Float32|Float32Point|Float64|Float80|Float96|FourCharCode|Fract|FractPtr\n|Handle|ItemCount|LogicalAddress|OptionBits|OSErr|OSStatus|OSType|OSTypePtr|PhysicalAddress|ProcessSerialNumber\n|ProcessSerialNumberPtr|ProcHandle|Ptr|ResType|ResTypePtr|ShortFixed|ShortFixedPtr|SignedByte|SInt16|SInt32|SInt64\n|SInt8|Size|StrFileName|StringHandle|StringPtr|TimeBase|TimeRecord|TimeScale|TimeValue|TimeValue64|UInt16|UInt32\n|UInt64|UInt8|UniChar|UniCharCount|UniCharCountPtr|UniCharPtr|UnicodeScalarValue|UniversalProcHandle|UniversalProcPtr\n|UnsignedFixed|UnsignedFixedPtr|UnsignedWide|UTF16Char|UTF32Char|UTF8Char)\n\\b", "name": "support.type.mac-classic.c" }, "anon_pattern_13": { "match": "\\b([A-Za-z0-9_]+_t)\\b", "name": "support.type.posix-reserved.c" }, "anon_pattern_1
\\\\ |
[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.c" }, "block": { "patterns": [{ "begin": "{", "beginCaptures": { "0": { "name": "punctuation.section.block.begin.bracket.curly.c" } }, "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", "endCaptures": { "0": { "name": "punctuation.section.block.end.bracket.curly.c" } }, "name": "meta.block.c", "patterns": [{ "include": "#block_innards" }] }] }, "block_comment": { "patterns": [{ "begin": "\\s*+(\\/\\*)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.begin.c" } }, "end": "\\*\\/", "endCaptures": { "0": { "name": "punctuation.definition.comment.end.c" } }, "name": "comment.block.c" }, { "begin": "\\s*+(\\/\\*)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.begin.c" } }, "end": "\\*\\/", "endCaptures": { "0": { "name": "punctuation.definition.comment.end.c" } }, "name": "comment.block.c" }] }, "block_innards": { "patterns": [{ "include": "#preprocessor-rule-enabled-block" }, { "include": "#preprocessor-rule-disabled-block" }, { "include": "#preprocessor-rule-conditional-block" }, { "include": "#method_access" }, { "include": "#member_access" }, { "include": "#c_function_call" }, { "begin": "(?x)\n(?:\n(?:\n(?=\\s)(?<!else|new|return)\n(?<=\\w) \\s+(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\n)\n)\n(\n(?:[A-Za-z_][A-Za-z0-9_]*+ | :: )++\n|\n(?:(?<=operator) (?:[-*&<>=+!]+ | \\(\\) | \\[\\]))\n)\n\\s*(\\()", "beginCaptures": { "1": { "name": "variable.other.c" }, "2": { "name": "punctuation.section.parens.begin.bracket.round.initialization.c" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.parens.end.bracket.round.initialization.c" } }, "name": "meta.initialization.c", "patterns": [{ "include": "#function-call-innards" }] }, { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.section.block.begin.bracket.curly.c" } }, "end": "}|(?=\\s*#\\s*(?:elif|else|endif)\\b)", "endCaptures": { "0": { "name": "punctuation.section.block.end.bracket.curly.c" } }, "patterns": [{ "include": "#block_innards" }] }, { "include": "#parens-block" }, { "include": "$self" }] }, "c_conditional_context": { "patterns": [{ "include": "$self" }, { "include": "#block_innards" }] }, "c_function_call": { "begin": "(?x)\n(?!(?:while|for|do|if|else|switch|catch|enumerate|return|typeid|alignof|alignas|sizeof|[cr]?iterate|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*\\(\n|\n(?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\\s*\\(\n)", "end": "(?<=\\))(?!\\w)", "name": "meta.function-call.c", "patterns": [{ "include": "#function-call-innards" }] }, "case_statement": { "begin": "((?>(?:(?:(?>(?<!\\s)\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?<!\\w)case(?!\\w))", "beginCaptures": { "1": { "patterns": [{ "include": "#inline_comment" }] }, "2": { "name": "comment.block.c punctuation.definition.comment.begin.c" }, "3": { "name": "comment.block.c" }, "4": { "patterns": [{ "match": "\\*\\/", "name": "comment.block.c punctuation.definition.comment.end.c" }, { "match": "\\*", "name": "comment.block.c" }] }, "5": { "name": "keyword.control.case.c" } }, "end": "(:)", "endCaptures": { "1": { "name": "punctuation.separator.colon.case.c" } }, "name": "meta.conditional.case.c", "patterns": [{ "include": "#evaluation_context" }, { "include": "#c_conditional_context" }] }, "comments": { "patterns": [{ "patterns": [{ "patterns": [{ "begin": "(?:^)(?>\\s*)(\\/\\/[!\\/]+)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.documentation.c" } }, "end": "(?<=\\n)(?<!\\\\\\n)", "name": "comment.line.double-slash.documentation.c", "patterns": [{ "include": "#line_continuation_character" }, { "match": '(?<=[\\s*!\\/])[\\\\@](?:callergraph|callgraph|else|endif|f\\$|f\\[|f\\]|hidecallergraph|hidecallgraph|hiderefby|hiderefs|hideinitializer|htmlinclude|n|nosubgrouping|private|privatesection|protected|protectedsection|public|publicsection|pure|showinitial
\\\\ |
[abefnprtv'"?] |
[0-3]\\d{,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.c" }, { "match": "\\\\.", "name": "invalid.illegal.unknown-escape.c" }] }, "string_placeholder": { "patterns": [{ "match": "(?x) %\n(\\d+\\$)?\n[#0\\- +']*\n[,;:_]?\n((-?\\d+)|\\*(-?\\d+\\$)?)?\n(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)?\n(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)?\n[diouxXDOUeEfFgGaACcSspn%]", "name": "constant.other.placeholder.c" }, { "captures": { "1": { "name": "invalid.illegal.placeholder.c" } }, "match": '(%)(?!"\\s*(PRI|SCN))' }] }, "strings": { "patterns": [{ "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.c" } }, "end": '"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.c" } }, "name": "string.quoted.double.c", "patterns": [{ "include": "#string_escaped_char" }, { "include": "#string_placeholder" }, { "include": "#line_continuation_character" }] }, { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.c" } }, "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.c" } }, "name": "string.quoted.single.c", "patterns": [{ "include": "#string_escaped_char" }, { "include": "#line_continuation_character" }] }] }, "switch_conditional_parentheses": { "begin": "((?>(?:(?:(?>(?<!\\s)\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", "beginCaptures": { "1": { "patterns": [{ "include": "#inline_comment" }] }, "2": { "name": "comment.block.c punctuation.definition.comment.begin.c" }, "3": { "name": "comment.block.c" }, "4": { "patterns": [{ "match": "\\*\\/", "name": "comment.block.c punctuation.definition.comment.end.c" }, { "match": "\\*", "name": "comment.block.c" }] }, "5": { "name": "punctuation.section.parens.begin.bracket.round.conditional.switch.c" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.section.parens.end.bracket.round.conditional.switch.c" } }, "name": "meta.conditional.switch.c", "patterns": [{ "include": "#evaluation_context" }, { "include": "#c_conditional_context" }] }, "switch_statement": { "begin": "(((?>(?:(?:(?>(?<!\\s)\\s+)|(\\/\\*)((?>(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?<!\\w)switch(?!\\w)))", "beginCaptures": { "1": { "name": "meta.head.switch.c" }, "2": { "patterns": [{ "include": "#inline_comment" }] }, "3": { "name": "comment.block.c punctuation.definition.comment.begin.c" }, "4": { "name": "comment.block.c" }, "5": { "patterns": [{ "match": "\\*\\/", "name": "comment.block.c punctuation.definition.comment.end.c" }, { "match": "\\*", "name": "comment.block.c" }] }, "6": { "name": "keyword.control.switch.c" } }, "end": "(?:(?<=\\}|%>|\\?\\?>)|(?=[;>\\[\\]=]))", "name": "meta.block.switch.c", "patterns": [{ "begin": "\\G ?", "end": "((?:\\{|<%|\\?\\?<|(?=;)))", "endCaptures": { "1": { "name": "punctuation.section.block.begin.bracket.curly.switch.c" } }, "name": "meta.head.switch.c", "patterns": [{ "include": "#switch_conditional_parentheses" }, { "include": "$self" }] }, { "begin": "(?<=\\{|<%|\\?\\?<)", "end": "(\\}|%>|\\?\\?>)", "endCaptures": { "1": { "name": "punctuation.section.block.end.bracket.curly.switch.c" } }, "name": "meta.body.switch.c", "patterns": [{ "include": "#default_statement" }, { "include": "#case_statement" }, { "include": "$self" }, { "include": "#block_innards" }] }, { "begin": "(?<=\\}|%>|\\?\\?>)[\\s\\n]*", "end": "[\\s\\n]*(?=;)", "name": "meta.tail.switch.c", "patterns": [{ "include": "$self" }] }] }, "vararg_ellipses": { "match": "(?<!\\.)\\.\\.\\.(?!\\.)", "name": "punctuation.vararg-ellipses.c" } }, "scopeName": "source.c" });
var c = [
lang
];
export { c as default };