UNPKG

vue-files-preview-inno

Version:

A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.

284 lines (283 loc) 7.46 kB
var _, E; function A() { if (E) return _; E = 1; function g(e) { const r = e.regex, t = e.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), d = "decltype\\(auto\\)", o = "[a-zA-Z_]\\w*::", m = "(" + d + "|" + r.optional(o) + "[a-zA-Z_]\\w*" + r.optional("<[^<>]+>") + ")", s = { className: "type", variants: [ { begin: "\\b[a-z\\d_]*_t\\b" }, { match: /\batomic_[a-z]{3,6}\b/ } ] }, a = { className: "string", variants: [ { begin: '(u8?|U|L)?"', end: '"', illegal: "\\n", contains: [e.BACKSLASH_ESCAPE] }, { begin: "(u8?|U|L)?'(" + "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)" + "|.)", end: "'", illegal: "." }, e.END_SAME_AS_BEGIN({ begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/, end: /\)([^()\\ ]{0,16})"/ }) ] }, c = { className: "number", variants: [ { begin: "\\b(0b[01']+)" }, { begin: "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" }, { begin: "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" } ], relevance: 0 }, i = { className: "meta", begin: /#\s*[a-z]+\b/, end: /$/, keywords: { keyword: "if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include" }, contains: [ { begin: /\\\n/, relevance: 0 }, e.inherit(a, { className: "string" }), { className: "string", begin: /<.*?>/ }, t, e.C_BLOCK_COMMENT_MODE ] }, p = { className: "title", begin: r.optional(o) + e.IDENT_RE, relevance: 0 }, u = r.optional(o) + e.IDENT_RE + "\\s*\\(", n = { 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", // aliases "alignas", "alignof", "noreturn", "static_assert", "thread_local", // not a C keyword but is, for all intents and purposes, treated exactly like one. "_Pragma" ], 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", // modifiers "const", "static", "constexpr", // aliases "complex", "bool", "imaginary" ], literal: "true false NULL", // TODO: apply hinting work similar to what was done in cpp.js 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" }, l = [ i, s, t, e.C_BLOCK_COMMENT_MODE, c, a ], f = { // This mode covers expression context where we can't expect a function // definition and shouldn't highlight anything that looks like one: // `return some()`, `else if()`, `(x*sum(1, 2))` variants: [ { begin: /=/, end: /;/ }, { begin: /\(/, end: /\)/ }, { beginKeywords: "new throw return else", end: /;/ } ], keywords: n, contains: l.concat([ { begin: /\(/, end: /\)/, keywords: n, contains: l.concat(["self"]), relevance: 0 } ]), relevance: 0 }, b = { begin: "(" + m + "[\\*&\\s]+)+" + u, returnBegin: !0, end: /[{;=]/, excludeEnd: !0, keywords: n, illegal: /[^\w\s\*&:<>.]/, contains: [ { // to prevent it from being confused as the function title begin: d, keywords: n, relevance: 0 }, { begin: u, returnBegin: !0, contains: [e.inherit(p, { className: "title.function" })], relevance: 0 }, // allow for multiple declarations, e.g.: // extern void f(int), g(char); { relevance: 0, match: /,/ }, { className: "params", begin: /\(/, end: /\)/, keywords: n, relevance: 0, contains: [ t, e.C_BLOCK_COMMENT_MODE, a, c, s, // Count matching parentheses. { begin: /\(/, end: /\)/, keywords: n, relevance: 0, contains: [ "self", t, e.C_BLOCK_COMMENT_MODE, a, c, s ] } ] }, s, t, e.C_BLOCK_COMMENT_MODE, i ] }; return { name: "C", aliases: ["h"], keywords: n, // Until differentiations are added between `c` and `cpp`, `c` will // not be auto-detected to avoid auto-detect conflicts between C and C++ disableAutodetect: !0, illegal: "</", contains: [].concat( f, b, l, [ i, { begin: e.IDENT_RE + "::", keywords: n }, { className: "class", beginKeywords: "enum class struct union", end: /[{;:<>=]/, contains: [ { beginKeywords: "final class struct" }, e.TITLE_MODE ] } ] ), exports: { preprocessor: i, strings: a, keywords: n } }; } return _ = g, _; } export { A as __require }; //# sourceMappingURL=c.mjs.map