vue-files-preview-inno
Version:
A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.
267 lines (266 loc) • 4.77 kB
JavaScript
var a, p;
function C() {
if (p) return a;
p = 1;
function T(s) {
const n = s.regex, e = /[a-zA-Z]\w*/, t = [
"as",
"break",
"class",
"construct",
"continue",
"else",
"for",
"foreign",
"if",
"import",
"in",
"is",
"return",
"static",
"var",
"while"
], c = [
"true",
"false",
"null"
], o = [
"this",
"super"
], _ = [
"Bool",
"Class",
"Fiber",
"Fn",
"List",
"Map",
"Null",
"Num",
"Object",
"Range",
"Sequence",
"String",
"System"
], r = [
"-",
"~",
/\*/,
"%",
/\.\.\./,
/\.\./,
/\+/,
"<<",
">>",
">=",
"<=",
"<",
">",
/\^/,
/!=/,
/!/,
/\bis\b/,
"==",
"&&",
"&",
/\|\|/,
/\|/,
/\?:/,
"="
], i = {
relevance: 0,
match: n.concat(/\b(?!(if|while|for|else|super)\b)/, e, /(?=\s*[({])/),
className: "title.function"
}, R = {
match: n.concat(
n.either(
n.concat(/\b(?!(if|while|for|else|super)\b)/, e),
n.either(...r)
),
/(?=\s*\([^)]+\)\s*\{)/
),
className: "title.function",
starts: { contains: [
{
begin: /\(/,
end: /\)/,
contains: [
{
relevance: 0,
scope: "params",
match: e
}
]
}
] }
}, h = {
variants: [
{ match: [
/class\s+/,
e,
/\s+is\s+/,
e
] },
{ match: [
/class\s+/,
e
] }
],
scope: {
2: "title.class",
4: "title.class.inherited"
},
keywords: t
}, l = {
relevance: 0,
match: n.either(...r),
className: "operator"
}, A = {
className: "string",
begin: /"""/,
end: /"""/
}, S = {
className: "property",
begin: n.concat(/\./, n.lookahead(e)),
end: e,
excludeBegin: !0,
relevance: 0
}, E = {
relevance: 0,
match: n.concat(/\b_/, e),
scope: "variable"
}, m = {
relevance: 0,
match: /\b[A-Z]+[a-z]+([A-Z]+[a-z]+)*/,
scope: "title.class",
keywords: { _ }
}, b = s.C_NUMBER_MODE, O = {
match: [
e,
/\s*/,
/=/,
/\s*/,
/\(/,
e,
/\)\s*\{/
],
scope: {
1: "title.function",
3: "operator",
6: "params"
}
}, g = s.COMMENT(
/\/\*\*/,
/\*\//,
{ contains: [
{
match: /@[a-z]+/,
scope: "doctag"
},
"self"
] }
), u = {
scope: "subst",
begin: /%\(/,
end: /\)/,
contains: [
b,
m,
i,
E,
l
]
}, N = {
scope: "string",
begin: /"/,
end: /"/,
contains: [
u,
{
scope: "char.escape",
variants: [
{ match: /\\\\|\\["0%abefnrtv]/ },
{ match: /\\x[0-9A-F]{2}/ },
{ match: /\\u[0-9A-F]{4}/ },
{ match: /\\U[0-9A-F]{8}/ }
]
}
]
};
u.contains.push(N);
const I = [
...t,
...o,
...c
], d = {
relevance: 0,
match: n.concat(
"\\b(?!",
I.join("|"),
"\\b)",
/[a-zA-Z_]\w*(?:[?!]|\b)/
),
className: "variable"
};
return {
name: "Wren",
keywords: {
keyword: t,
"variable.language": o,
literal: c
},
contains: [
{
// scope: "meta",
scope: "comment",
variants: [
{
begin: [
/#!?/,
/[A-Za-z_]+(?=\()/
],
beginScope: {
// 2: "attr"
},
keywords: { literal: c },
contains: [
// NUMBER,
// VARIABLE
],
end: /\)/
},
{
begin: [
/#!?/,
/[A-Za-z_]+/
],
beginScope: {
// 2: "attr"
},
end: /$/
}
]
},
b,
N,
A,
g,
s.C_LINE_COMMENT_MODE,
s.C_BLOCK_COMMENT_MODE,
m,
h,
O,
R,
i,
l,
E,
S,
d
]
};
}
return a = T, a;
}
export {
C as __require
};
//# sourceMappingURL=wren.mjs.map