annotate third_party/highlight/languages/c.min.js @ 201:6cdee35a7ba9

[MrJuneJune] notes
author MrJuneJune <me@mrjunejune.com>
date Sun, 15 Feb 2026 07:07:50 -0800
parents 2db6253f355d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
157
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
1 /*! `c` grammar compiled for Highlight.js 11.11.1 */
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
2 (()=>{var e=(()=>{"use strict";return e=>{const t=e.regex,n=e.COMMENT("//","$",{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
3 contains:[{begin:/\\\n/}]
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
4 }),a="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",r="("+a+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",i={
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
5 className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
6 match:/\batomic_[a-z]{3,6}\b/}]},l={className:"string",variants:[{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
7 begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
8 begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
9 end:"'",illegal:"."},e.END_SAME_AS_BEGIN({
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
10 begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
11 className:"number",variants:[{match:/\b(0b[01']+)/},{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
12 match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
13 },{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
14 match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
15 },{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
16 },c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
17 keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
18 },contains:[{begin:/\\\n/,relevance:0},e.inherit(l,{className:"string"}),{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
19 className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
20 className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
21 },_=t.optional(s)+e.IDENT_RE+"\\s*\\(",u={
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
22 keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
23 type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
24 literal:"true false NULL",
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
25 built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
26 },m=[c,i,n,e.C_BLOCK_COMMENT_MODE,o,l],g={variants:[{begin:/=/,end:/;/},{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
27 begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
28 keywords:u,contains:m.concat([{begin:/\(/,end:/\)/,keywords:u,
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
29 contains:m.concat(["self"]),relevance:0}]),relevance:0},p={
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
30 begin:"("+r+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
31 keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:u,relevance:0},{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
32 begin:_,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})],
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
33 relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
34 keywords:u,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,l,o,i,{begin:/\(/,
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
35 end:/\)/,keywords:u,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,l,o,i]
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
36 }]},i,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:u,
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
37 disableAutodetect:!0,illegal:"</",contains:[].concat(g,p,m,[c,{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
38 begin:e.IDENT_RE+"::",keywords:u},{className:"class",
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
39 beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
40 beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,
2db6253f355d [ThirdParty] Added highlight library for better readability on blog.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
41 strings:l,keywords:u}}}})();hljs.registerLanguage("c",e)})();