1
|
{"version":3,"sources":["webpack:///./node_modules/highlight.js/lib/languages/c.js"],"names":["source","re","optional","args","joined","map","x","join","concat","module","exports","hljs","lang","C_LINE_COMMENT_MODE","COMMENT","contains","begin","FUNCTION_TYPE_RE","CPP_PRIMITIVE_TYPES","className","STRINGS","variants","end","illegal","BACKSLASH_ESCAPE","END_SAME_AS_BEGIN","NUMBERS","relevance","PREPROCESSOR","keywords","inherit","C_BLOCK_COMMENT_MODE","TITLE_MODE","IDENT_RE","FUNCTION_TITLE","CPP_KEYWORDS","keyword","built_in","literal","EXPRESSION_CONTAINS","EXPRESSION_CONTEXT","beginKeywords","FUNCTION_DECLARATION","returnBegin","excludeEnd","aliases","disableAutodetect","preprocessor","strings","cLike","name"],"mappings":"mGASA,SAASA,EAAOC,GACd,OAAKA,EACa,iBAAPA,EAAwBA,EAE5BA,EAAGD,OAHM,KAUlB,SAASE,EAASD,GAChB,OAOF,WAAyB,2BAANE,EAAM,yBAANA,EAAM,gBACvB,IAAMC,EAASD,EAAKE,KAAI,SAACC,GAAD,OAAON,EAAOM,MAAIC,KAAK,IAC/C,OAAOH,EATAI,CAAO,IAAKP,EAAI,MA6TzBQ,EAAOC,QAdP,SAAWC,GACT,IAAMC,EA7RR,SAAeD,GAIb,IAAME,EAAsBF,EAAKG,QAAQ,KAAM,IAAK,CAClDC,SAAU,CACR,CACEC,MAAO,WAOPC,EAAmB,uBAEvBf,EAJmB,mBAKnB,gBAAkBA,EAJS,YAK7B,IACMgB,EAAsB,CAC1BC,UAAW,UACXH,MAAO,sBAMHI,EAAU,CACdD,UAAW,SACXE,SAAU,CACR,CACEL,MAAO,cACPM,IAAK,IACLC,QAAS,MACTR,SAAU,CAAEJ,EAAKa,mBAEnB,CACER,MAAO,sEACPM,IAAK,IACLC,QAAS,KAEXZ,EAAKc,kBAAkB,CACrBT,MAAO,mCACPM,IAAK,0BAKLI,EAAU,CACdP,UAAW,SACXE,SAAU,CACR,CACEL,MAAO,iBAET,CACEA,MAAO,mEA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Z,SAAU,CACR,OACAF,EACAF,EAAKoB,qBACLX,EACAM,EACAR,MAKRA,EACAL,EACAF,EAAKoB,qBACLH,IAIJ,MAAO,CACLiB,QAAS,CACP,IACA,KACA,IACA,MACA,MACA,MACA,KACA,MACA,OAEFhB,SAAUM,EAGVW,mBAAmB,EACnBvB,QAAS,KACTR,SAAU,GAAGP,OACXgC,EACAE,EACAH,EACA,CACEX,EACA,CACEZ,MAAO,uKACPM,IAAK,IACLO,SAAUM,EACVpB,SAAU,CACR,OACAG,IAGJ,CACEF,MAAOL,EAAKsB,SAAW,KACvBJ,SAAUM,GAEZ,CACEhB,UAAW,QACXsB,cAAe,0BACfnB,IAAK,WACLP,SAAU,CACR,CACE0B,cAAe,sBAEjB9B,EAAKqB,eAIbtB,QAAS,CACPqC,aAAcnB,EACdoB,QAAS5B,EACTS,SAAUM,IAaDc,CAAMtC,GAUnB,OAFAC,EAAKsC,KAAO,IACZtC,EAAKiC,QAAU,CAAC,IAAK,KACdjC","file":"highlight/c.js?v=79c2fd7141206a7982c7","sourcesContent":["/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n if (!re) return null;\n if (typeof re === \"string\") return re;\n\n return re.source;\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction optional(re) {\n return concat('(', re, ')?');\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n const joined = args.map((x) => source(x)).join(\"\");\n return joined;\n}\n\n/*\nLanguage: C-like foundation grammar for C/C++ grammars\nAuthor: Ivan Sagalaev <maniac@softwaremaniacs.org>\nContributors: Evgeny Stepanischev <imbolk@gmail.com>, Zaven Muradyan <megalivoithos@gmail.com>, Roel Deckers <admin@codingcat.nl>, Sam Wu <samsam2310@gmail.com>, Jordi Petit <jordi.petit@gmail.com>, Pieter Vantorre <pietervantorre@gmail.com>, Google Inc. (David Benjamin) <davidben@google.com>\n*/\n\n/** @type LanguageFn */\nfunction cLike(hljs) {\n // added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does\n // not include such support nor can we be sure all the grammars depending\n // on it would desire this behavior\n const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', {\n contains: [\n {\n begin: /\\\\\\n/\n }\n ]\n });\n const DECLTYPE_AUTO_RE = 'decltype\\\\(auto\\\\)';\n const NAMESPACE_RE = '[a-zA-Z_]\\\\w*::';\n const TEMPLATE_ARGUMENT_RE = '<[^<>]+>';\n const FUNCTION_TYPE_RE = '(' +\n DECLTYPE_AUTO_RE + '|' +\n optional(NAMESPACE_RE) +\n '[a-zA-Z_]\\\\w*' + optional(TEMPLATE_ARGUMENT_RE) +\n ')';\n const CPP_PRIMITIVE_TYPES = {\n className: 'keyword',\n begin: '\\\\b[a-z\\\\d_]*_t\\\\b'\n };\n\n // https://en.cppreference.com/w/cpp/language/escape\n // \\\\ \\x \\xFF \\u2837 \\u00323747 \\374\n const CHARACTER_ESCAPES = '\\\\\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\\\S)';\n const STRINGS = {\n className: 'string',\n variants: [\n {\n begin: '(u8?|U|L)?\"',\n end: '\"',\n illegal: '\\\\n',\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '(u8?|U|L)?\\'(' + CHARACTER_ESCAPES + \"|.)\",\n end: '\\'',\n illegal: '.'\n },\n hljs.END_SAME_AS_BEGIN({\n begin: /(?:u8?|U|L)?R\"([^()\\\\ ]{0,16})\\(/,\n end: /\\)([^()\\\\ ]{0,16})\"/\n })\n ]\n };\n\n const NUMBERS = {\n className: 'number',\n variants: [\n {\n begin: '\\\\b(0b[01\\']+)'\n },\n {\n begin: '(-?)\\\\b([\\\\d\\']+(\\\\.[\\\\d\\']*)?|\\\\.[\\\\d\\']+)(u|U|l|L|ul|UL|f|F|b|B)'\n },\n {\n begin: '(-?)(\\\\b0[xX][a-fA-F0-9\\']+|(\\\\b[\\\\d\\']+(\\\\.[\\\\d\\']*)?|\\\\.[\\\\d\\']+)([eE][-+]?[\\\\d\\']+)?)'\n }\n ],\n relevance: 0\n };\n\n const PREPROCESSOR = {\n className: 'meta',\n begin: /#\\s*[a-z]+\\b/,\n end: /$/,\n keywords: {\n 'meta-keyword':\n 'if else elif endif define undef warning error line ' +\n 'pragma _Pragma ifdef ifndef include'\n },\n contains: [\n {\n begin: /\\\\\\n/,\n relevance: 0\n },\n hljs.inherit(STRINGS, {\n className: 'meta-string'\n }),\n {\n className: 'meta-string',\n begin: /<.*?>/,\n end: /$/,\n illegal: '\\\\n'\n },\n C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE\n ]\n };\n\n const TITLE_MODE = {\n className: 'title',\n begin: optional(NAMESPACE_RE) + hljs.IDENT_RE,\n relevance: 0\n };\n\n const FUNCTION_TITLE = optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\\\s*\\\\(';\n\n const CPP_KEYWORDS = {\n keyword: 'int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof ' +\n 'dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace ' +\n 'unsigned long volatile static protected bool template mutable if public friend ' +\n 'do goto auto void enum else break extern using asm case typeid wchar_t ' +\n 'short reinterpret_cast|10 default double register explicit signed typename try this ' +\n 'switch continue inline delete alignas alignof constexpr consteval constinit decltype ' +\n 'concept co_await co_return co_yield requires ' +\n 'noexcept static_assert thread_local restrict final override ' +\n 'atomic_bool atomic_char atomic_schar ' +\n 'atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong ' +\n 'atomic_ullong new throw return ' +\n 'and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq',\n built_in: 'std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream ' +\n 'auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set ' +\n 'unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos ' +\n 'asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp ' +\n 'fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper ' +\n 'isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow ' +\n 'printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp ' +\n 'strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan ' +\n 'vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary',\n literal: 'true false nullptr NULL'\n };\n\n const EXPRESSION_CONTAINS = [\n PREPROCESSOR,\n CPP_PRIMITIVE_TYPES,\n C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n NUMBERS,\n STRINGS\n ];\n\n const EXPRESSION_CONTEXT = {\n // This mode covers expression context where we can't expect a function\n // definition and shouldn't highlight anything that looks like one:\n // `return some()`, `else if()`, `(x*sum(1, 2))`\n variants: [\n {\n begin: /=/,\n end: /;/\n },\n {\n begin: /\\(/,\n end: /\\)/\n },\n {\n beginKeywords: 'new throw return else',\n end: /;/\n }\n ],\n keywords: CPP_KEYWORDS,\n contains: EXPRESSION_CONTAINS.concat([\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: CPP_KEYWORDS,\n contains: EXPRESSION_CONTAINS.concat([ 'self' ]),\n relevance: 0\n }\n ]),\n relevance: 0\n };\n\n const FUNCTION_DECLARATION = {\n className: 'function',\n begin: '(' + FUNCTION_TYPE_RE + '[\\\\*&\\\\s]+)+' + FUNCTION_TITLE,\n returnBegin: true,\n end: /[{;=]/,\n excludeEnd: true,\n keywords: CPP_KEYWORDS,\n illegal: /[^\\w\\s\\*&:<>]/,\n contains: [\n { // to prevent it from being confused as the function title\n begin: DECLTYPE_AUTO_RE,\n keywords: CPP_KEYWORDS,\n relevance: 0\n },\n {\n begin: FUNCTION_TITLE,\n returnBegin: true,\n contains: [ TITLE_MODE ],\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n keywords: CPP_KEYWORDS,\n relevance: 0,\n contains: [\n C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n STRINGS,\n NUMBERS,\n CPP_PRIMITIVE_TYPES,\n // Count matching parentheses.\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: CPP_KEYWORDS,\n relevance: 0,\n contains: [\n 'self',\n C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n STRINGS,\n NUMBERS,\n CPP_PRIMITIVE_TYPES\n ]\n }\n ]\n },\n CPP_PRIMITIVE_TYPES,\n C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n PREPROCESSOR\n ]\n };\n\n return {\n aliases: [\n 'c',\n 'cc',\n 'h',\n 'c++',\n 'h++',\n 'hpp',\n 'hh',\n 'hxx',\n 'cxx'\n ],\n keywords: CPP_KEYWORDS,\n // the base c-like language will NEVER be auto-detected, rather the\n // derivitives: c, c++, arduino turn auto-detect back on for themselves\n disableAutodetect: true,\n illegal: '</',\n contains: [].concat(\n EXPRESSION_CONTEXT,\n FUNCTION_DECLARATION,\n EXPRESSION_CONTAINS,\n [\n PREPROCESSOR,\n { // containers: ie, `vector <int> rooms (9);`\n begin: '\\\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\\\s*<',\n end: '>',\n keywords: CPP_KEYWORDS,\n contains: [\n 'self',\n CPP_PRIMITIVE_TYPES\n ]\n },\n {\n begin: hljs.IDENT_RE + '::',\n keywords: CPP_KEYWORDS\n },\n {\n className: 'class',\n beginKeywords: 'enum class struct union',\n end: /[{;:<>=]/,\n contains: [\n {\n beginKeywords: \"final class struct\"\n },\n hljs.TITLE_MODE\n ]\n }\n ]),\n exports: {\n preprocessor: PREPROCESSOR,\n strings: STRINGS,\n keywords: CPP_KEYWORDS\n }\n };\n}\n\n/*\nLanguage: C\nCategory: common, system\nWebsite: https://en.wikipedia.org/wiki/C_(programming_language)\n*/\n\n/** @type LanguageFn */\nfunction c(hljs) {\n const lang = cLike(hljs);\n // Until C is actually different than C++ there is no reason to auto-detect C\n // as it's own language since it would just fail auto-detect testing or\n // simply match with C++.\n //\n // See further comments in c-like.js.\n\n // lang.disableAutodetect = false;\n lang.name = 'C';\n lang.aliases = ['c', 'h'];\n return lang;\n}\n\nmodule.exports = c;\n"],"sourceRoot":""}
|