vue-files-preview-inno
Version:
A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.
221 lines (220 loc) • 5.52 kB
JavaScript
var r, c;
function p() {
if (c) return r;
c = 1;
function d(l) {
const n = "\\d(_|\\d)*", s = "[eE][-+]?" + n, u = n + "(\\." + n + ")?(" + s + ")?", t = "\\w+", g = "\\b(" + (n + "#" + t + "(\\." + t + ")?#(" + s + ")?") + "|" + u + ")", a = "[A-Za-z](_?[A-Za-z0-9.])*", e = `[]\\{\\}%#'"`, i = l.COMMENT("--", "$"), o = {
// TODO: These spaces are not required by the Ada syntax
// however, I have yet to see handwritten Ada code where
// someone does not put spaces around :
begin: "\\s+:\\s+",
end: "\\s*(:=|;|\\)|=>|$)",
// endsWithParent: true,
// returnBegin: true,
illegal: e,
contains: [
{
// workaround to avoid highlighting
// named loops and declare blocks
beginKeywords: "loop for declare others",
endsParent: !0
},
{
// properly highlight all modifiers
className: "keyword",
beginKeywords: "not null constant access function procedure in out aliased exception"
},
{
className: "type",
begin: a,
endsParent: !0,
relevance: 0
}
]
};
return {
name: "Ada",
case_insensitive: !0,
keywords: {
keyword: [
"abort",
"else",
"new",
"return",
"abs",
"elsif",
"not",
"reverse",
"abstract",
"end",
"accept",
"entry",
"select",
"access",
"exception",
"of",
"separate",
"aliased",
"exit",
"or",
"some",
"all",
"others",
"subtype",
"and",
"for",
"out",
"synchronized",
"array",
"function",
"overriding",
"at",
"tagged",
"generic",
"package",
"task",
"begin",
"goto",
"pragma",
"terminate",
"body",
"private",
"then",
"if",
"procedure",
"type",
"case",
"in",
"protected",
"constant",
"interface",
"is",
"raise",
"use",
"declare",
"range",
"delay",
"limited",
"record",
"when",
"delta",
"loop",
"rem",
"while",
"digits",
"renames",
"with",
"do",
"mod",
"requeue",
"xor"
],
literal: [
"True",
"False"
]
},
contains: [
i,
// strings "foobar"
{
className: "string",
begin: /"/,
end: /"/,
contains: [
{
begin: /""/,
relevance: 0
}
]
},
// characters ''
{
// character literals always contain one char
className: "string",
begin: /'.'/
},
{
// number literals
className: "number",
begin: g,
relevance: 0
},
{
// Attributes
className: "symbol",
begin: "'" + a
},
{
// package definition, maybe inside generic
className: "title",
begin: "(\\bwith\\s+)?(\\bprivate\\s+)?\\bpackage\\s+(\\bbody\\s+)?",
end: "(is|$)",
keywords: "package body",
excludeBegin: !0,
excludeEnd: !0,
illegal: e
},
{
// function/procedure declaration/definition
// maybe inside generic
begin: "(\\b(with|overriding)\\s+)?\\b(function|procedure)\\s+",
end: "(\\bis|\\bwith|\\brenames|\\)\\s*;)",
keywords: "overriding function procedure with is renames return",
// we need to re-match the 'function' keyword, so that
// the title mode below matches only exactly once
returnBegin: !0,
contains: [
i,
{
// name of the function/procedure
className: "title",
begin: "(\\bwith\\s+)?\\b(function|procedure)\\s+",
end: "(\\(|\\s+|$)",
excludeBegin: !0,
excludeEnd: !0,
illegal: e
},
// 'self'
// // parameter types
o,
{
// return type
className: "type",
begin: "\\breturn\\s+",
end: "(\\s+|;|$)",
keywords: "return",
excludeBegin: !0,
excludeEnd: !0,
// we are done with functions
endsParent: !0,
illegal: e
}
]
},
{
// new type declarations
// maybe inside generic
className: "type",
begin: "\\b(sub)?type\\s+",
end: "\\s+",
keywords: "type",
excludeBegin: !0,
illegal: e
},
// see comment above the definition
o
// no markup
// relevance boosters for small snippets
// {begin: '\\s*=>\\s*'},
// {begin: '\\s*:=\\s*'},
// {begin: '\\s+:=\\s+'},
]
};
}
return r = d, r;
}
export {
p as __require
};
//# sourceMappingURL=ada.mjs.map