1
|
{"version":3,"sources":["webpack:///./node_modules/highlight.js/lib/languages/cpp.js"],"names":["module","exports","hljs","CPP_PRIMITIVE_TYPES","className","begin","STRINGS","variants","end","illegal","contains","BACKSLASH_ESCAPE","NUMBERS","relevance","PREPROCESSOR","keywords","inherit","C_LINE_COMMENT_MODE","C_BLOCK_COMMENT_MODE","FUNCTION_TITLE","IDENT_RE","CPP_KEYWORDS","keyword","built_in","literal","EXPRESSION_CONTAINS","aliases","concat","beginKeywords","returnBegin","excludeEnd","TITLE_MODE","preprocessor","strings"],"mappings":"oFAAAA,EAAOC,QAAU,SAASC,GACxB,IAAIC,EAAsB,CACxBC,UAAW,UACXC,MAAO,sBAMLC,EAAU,CACZF,UAAW,SACXG,SAAU,CACR,CACEF,MAAO,cAAeG,IAAK,IAC3BC,QAAS,MACTC,SAAU,CAACR,EAAKS,mBAElB,CACEN,MAAO,sEAA6CG,IAAK,IACzDC,QAAS,KAEX,CAAEJ,MAAO,qDAITO,EAAU,CACZR,UAAW,SACXG,SAAU,CACR,CAAEF,MAAO,iBACT,CAAEA,MAAO,mEACT,CAAEA,MAAO,wFAEXQ,UAAW,GAGTC,EAAqB,CACvBV,UAAW,OACXC,MAAO,eAAgBG,IAAK,IAC5BO,SAAU,CACR,eACE,kFAGJL,SAAU,CACR,CACEL,MAAO,OAAQQ,UAAW,GAE5BX,EAAKc,QAAQV,EAAS,CAACF,UAAW,gBAClC,CACEA,UAAW,cACXC,MAAO,YAAaG,IAAK,IACzBC,QAAS,OAEXP,EAAKe,oBACLf,EAAKgB,uBAILC,EAAiBjB,EAAKkB,SAAW,UAEjCC,EAAe,CACjBC,QAAS,gwBAYTC,SAAU,2wBASVC,QAAS,2BAGPC,EAAsB,CACxBtB,EACAD,EAAKe,oBACLf,EAAKgB,qBACLN,EACAN,GAGF,MAAO,CACLoB,QAAS,CAAC,IAAK,KAAM,IAAK,MAAO,MAAO,MAAO,KAAM,MAAO,OAC5DX,SAAUM,EACVZ,QAAS,KACTC,SAAUe,EAAoBE,OAAO,CACnCb,EACA,CACET,MAAO,mJAAoJG,IAAK,IAChKO,SAAUM,EACVX,SAAU,CAAC,OAAQP,IAErB,CACEE,MAAOH,EAAKkB,SAAW,KACvBL,SAAUM,GAEZ,CAIEd,SAAU,CACR,CAACF,MAAO,IAAKG,IAAK,KAClB,CAACH,MAAO,KAAMG,IAAK,MACnB,CAACoB,cAAe,wBAAyBpB,IAAK,MAEhDO,SAAUM,EACVX,SAAUe,EAAoBE,OAAO,CACnC,CACEtB,MAAO,KAAMG,IAAK,KAClBO,SAAUM,EACVX,SAAUe,EAAoBE,OAAO,CAAC,SACtCd,UAAW,KAGfA,UAAW,GAEb,CACET,UAAW,WACXC,MAAO,IAAMH,EAAKkB,SAAW,eAAiBD,EAC9CU,aAAa,EAAMrB,IAAK,QACxBsB,YAAY,EACZf,SAAUM,EACVZ,QAAS,aACTC,SAAU,CACR,CACEL,MAAOc,EAAgBU,aAAa,EACpCnB,SAAU,CAACR,EAAK6B,YAChBlB,UAAW,GAEb,CACET,UAAW,SACXC,MAAO,KAAMG,IAAK,KAClBO,SAAUM,EACVR,UAAW,EACXH,SAAU,CACRR,EAAKe,oBACLf,EAAKgB,qBACLZ,EACAM,EACAT,EAEA,CACEE,MAAO,KAAMG,IAAK,KAClBO,SAAUM,EACVR,UAAW,EACXH,SAAU,CACR,OACAR,EAAKe,oBACLf,EAAKgB,qBACLZ,EACAM,EACAT,MAKRD,EAAKe,oBACLf,EAAKgB,qBACLJ,IAGJ,CACEV,UAAW,QACXwB,cAAe,eAAgBpB,IAAK,QACpCE,SAAU,CACR,CAACL,MAAO,IAAKG,IAAK,IAAKE,SAAU,CAAC,SAClCR,EAAK6B,eAIX9B,QAAS,CACP+B,aAAclB,EACdmB,QAAS3B,EACTS,SAAUM","file":"highlight/cpp.js?v=76384fd976f320e17ffa","sourcesContent":["module.exports = function(hljs) {\n var 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 var CHARACTER_ESCAPES = '\\\\\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\\\S)'\n var STRINGS = {\n className: 'string',\n variants: [\n {\n begin: '(u8?|U|L)?\"', end: '\"',\n illegal: '\\\\n',\n contains: [hljs.BACKSLASH_ESCAPE]\n },\n {\n begin: '(u8?|U|L)?\\'(' + CHARACTER_ESCAPES + \"|.)\", end: '\\'',\n illegal: '.'\n },\n { begin: /(?:u8?|U|L)?R\"([^()\\\\ ]{0,16})\\((?:.|\\n)*?\\)\\1\"/ }\n ]\n };\n\n var NUMBERS = {\n className: 'number',\n variants: [\n { begin: '\\\\b(0b[01\\']+)' },\n { begin: '(-?)\\\\b([\\\\d\\']+(\\\\.[\\\\d\\']*)?|\\\\.[\\\\d\\']+)(u|U|l|L|ul|UL|f|F|b|B)' },\n { begin: '(-?)(\\\\b0[xX][a-fA-F0-9\\']+|(\\\\b[\\\\d\\']+(\\\\.[\\\\d\\']*)?|\\\\.[\\\\d\\']+)([eE][-+]?[\\\\d\\']+)?)' }\n ],\n relevance: 0\n };\n\n var PREPROCESSOR = {\n className: 'meta',\n begin: /#\\s*[a-z]+\\b/, end: /$/,\n keywords: {\n 'meta-keyword':\n 'if else elif endif define undef warning error line ' +\n 'pragma ifdef ifndef include'\n },\n contains: [\n {\n begin: /\\\\\\n/, relevance: 0\n },\n hljs.inherit(STRINGS, {className: 'meta-string'}),\n {\n className: 'meta-string',\n begin: /<[^\\n>]*>/, end: /$/,\n illegal: '\\\\n',\n },\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE\n ]\n };\n\n var FUNCTION_TITLE = hljs.IDENT_RE + '\\\\s*\\\\(';\n\n var CPP_KEYWORDS = {\n keyword: 'int float while private char 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 ' +\n 'short reinterpret_cast|10 default double register explicit signed typename try this ' +\n 'switch continue inline delete alignof constexpr consteval constinit decltype ' +\n 'concept co_await co_return co_yield requires ' +\n 'noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary ' +\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 or not',\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 bitset multiset multimap unordered_set ' +\n 'unordered_map unordered_multiset unordered_multimap array shared_ptr abort 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',\n literal: 'true false nullptr NULL'\n };\n\n var EXPRESSION_CONTAINS = [\n CPP_PRIMITIVE_TYPES,\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n NUMBERS,\n STRINGS\n ];\n\n return {\n aliases: ['c', 'cc', 'h', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx'],\n keywords: CPP_KEYWORDS,\n illegal: '</',\n contains: EXPRESSION_CONTAINS.concat([\n PREPROCESSOR,\n {\n begin: '\\\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\\\s*<', end: '>',\n keywords: CPP_KEYWORDS,\n contains: ['self', CPP_PRIMITIVE_TYPES]\n },\n {\n begin: hljs.IDENT_RE + '::',\n keywords: CPP_KEYWORDS\n },\n {\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 {begin: /=/, end: /;/},\n {begin: /\\(/, end: /\\)/},\n {beginKeywords: 'new throw return else', end: /;/}\n ],\n keywords: CPP_KEYWORDS,\n contains: EXPRESSION_CONTAINS.concat([\n {\n begin: /\\(/, end: /\\)/,\n keywords: CPP_KEYWORDS,\n contains: EXPRESSION_CONTAINS.concat(['self']),\n relevance: 0\n }\n ]),\n relevance: 0\n },\n {\n className: 'function',\n begin: '(' + hljs.IDENT_RE + '[\\\\*&\\\\s]+)+' + FUNCTION_TITLE,\n returnBegin: true, end: /[{;=]/,\n excludeEnd: true,\n keywords: CPP_KEYWORDS,\n illegal: /[^\\w\\s\\*&]/,\n contains: [\n {\n begin: FUNCTION_TITLE, returnBegin: true,\n contains: [hljs.TITLE_MODE],\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/, end: /\\)/,\n keywords: CPP_KEYWORDS,\n relevance: 0,\n contains: [\n hljs.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: /\\(/, end: /\\)/,\n keywords: CPP_KEYWORDS,\n relevance: 0,\n contains: [\n 'self',\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n STRINGS,\n NUMBERS,\n CPP_PRIMITIVE_TYPES\n ]\n }\n ]\n },\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n PREPROCESSOR\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class struct', end: /[{;:]/,\n contains: [\n {begin: /</, end: />/, contains: ['self']}, // skip generic stuff\n hljs.TITLE_MODE\n ]\n }\n ]),\n exports: {\n preprocessor: PREPROCESSOR,\n strings: STRINGS,\n keywords: CPP_KEYWORDS\n }\n };\n};"],"sourceRoot":""}
|