aboutsummaryrefslogtreecommitdiffstats
path: root/public/prism/prism-xquery.min.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/prism/prism-xquery.min.js')
-rw-r--r--public/prism/prism-xquery.min.js108
1 files changed, 54 insertions, 54 deletions
diff --git a/public/prism/prism-xquery.min.js b/public/prism/prism-xquery.min.js
index bbc15e6..794bb95 100644
--- a/public/prism/prism-xquery.min.js
+++ b/public/prism/prism-xquery.min.js
@@ -1,5 +1,5 @@
-!(function (r) {
- (r.languages.xquery = r.languages.extend('markup', {
+!(function (e) {
+ (e.languages.xquery = e.languages.extend('markup', {
'xquery-comment': {
pattern: /\(:[\s\S]*?:\)/,
greedy: !0,
@@ -48,76 +48,76 @@
],
punctuation: /[[\](){},;:/]/,
})),
- (r.languages.xquery.tag.pattern =
+ (e.languages.xquery.tag.pattern =
/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/),
- (r.languages.xquery.tag.inside['attr-value'].pattern =
+ (e.languages.xquery.tag.inside['attr-value'].pattern =
/=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+)/),
- (r.languages.xquery.tag.inside['attr-value'].inside.punctuation = /^="|"$/),
- (r.languages.xquery.tag.inside['attr-value'].inside.expression = {
+ (e.languages.xquery.tag.inside['attr-value'].inside.punctuation = /^="|"$/),
+ (e.languages.xquery.tag.inside['attr-value'].inside.expression = {
pattern: /\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}/,
- inside: r.languages.xquery,
+ inside: e.languages.xquery,
alias: 'language-xquery',
});
- var s = function (e) {
+ var t = function (e) {
return 'string' == typeof e
? e
: 'string' == typeof e.content
? e.content
- : e.content.map(s).join('');
+ : e.content.map(t).join('');
},
- l = function (e) {
- for (var t = [], n = 0; n < e.length; n++) {
- var a = e[n],
- o = !1;
+ n = function (a) {
+ for (var o = [], i = 0; i < a.length; i++) {
+ var r = a[i],
+ s = !1;
if (
- ('string' != typeof a &&
- ('tag' === a.type && a.content[0] && 'tag' === a.content[0].type
- ? '</' === a.content[0].content[0].content
- ? 0 < t.length &&
- t[t.length - 1].tagName === s(a.content[0].content[1]) &&
- t.pop()
- : '/>' === a.content[a.content.length - 1].content ||
- t.push({
- tagName: s(a.content[0].content[1]),
+ ('string' != typeof r &&
+ ('tag' === r.type && r.content[0] && 'tag' === r.content[0].type
+ ? '</' === r.content[0].content[0].content
+ ? o.length > 0 &&
+ o[o.length - 1].tagName === t(r.content[0].content[1]) &&
+ o.pop()
+ : '/>' === r.content[r.content.length - 1].content ||
+ o.push({
+ tagName: t(r.content[0].content[1]),
openedBraces: 0,
})
: !(
- 0 < t.length &&
- 'punctuation' === a.type &&
- '{' === a.content
+ o.length > 0 &&
+ 'punctuation' === r.type &&
+ '{' === r.content
) ||
- (e[n + 1] &&
- 'punctuation' === e[n + 1].type &&
- '{' === e[n + 1].content) ||
- (e[n - 1] &&
- 'plain-text' === e[n - 1].type &&
- '{' === e[n - 1].content)
- ? 0 < t.length &&
- 0 < t[t.length - 1].openedBraces &&
- 'punctuation' === a.type &&
- '}' === a.content
- ? t[t.length - 1].openedBraces--
- : 'comment' !== a.type && (o = !0)
- : t[t.length - 1].openedBraces++),
- (o || 'string' == typeof a) &&
- 0 < t.length &&
- 0 === t[t.length - 1].openedBraces)
+ (a[i + 1] &&
+ 'punctuation' === a[i + 1].type &&
+ '{' === a[i + 1].content) ||
+ (a[i - 1] &&
+ 'plain-text' === a[i - 1].type &&
+ '{' === a[i - 1].content)
+ ? o.length > 0 &&
+ o[o.length - 1].openedBraces > 0 &&
+ 'punctuation' === r.type &&
+ '}' === r.content
+ ? o[o.length - 1].openedBraces--
+ : 'comment' !== r.type && (s = !0)
+ : o[o.length - 1].openedBraces++),
+ (s || 'string' == typeof r) &&
+ o.length > 0 &&
+ 0 === o[o.length - 1].openedBraces)
) {
- var i = s(a);
- n < e.length - 1 &&
- ('string' == typeof e[n + 1] || 'plain-text' === e[n + 1].type) &&
- ((i += s(e[n + 1])), e.splice(n + 1, 1)),
- 0 < n &&
- ('string' == typeof e[n - 1] || 'plain-text' === e[n - 1].type) &&
- ((i = s(e[n - 1]) + i), e.splice(n - 1, 1), n--),
- /^\s+$/.test(i)
- ? (e[n] = i)
- : (e[n] = new r.Token('plain-text', i, null, i));
+ var l = t(r);
+ i < a.length - 1 &&
+ ('string' == typeof a[i + 1] || 'plain-text' === a[i + 1].type) &&
+ ((l += t(a[i + 1])), a.splice(i + 1, 1)),
+ i > 0 &&
+ ('string' == typeof a[i - 1] || 'plain-text' === a[i - 1].type) &&
+ ((l = t(a[i - 1]) + l), a.splice(i - 1, 1), i--),
+ /^\s+$/.test(l)
+ ? (a[i] = l)
+ : (a[i] = new e.Token('plain-text', l, null, l));
}
- a.content && 'string' != typeof a.content && l(a.content);
+ r.content && 'string' != typeof r.content && n(r.content);
}
};
- r.hooks.add('after-tokenize', function (e) {
- 'xquery' === e.language && l(e.tokens);
+ e.hooks.add('after-tokenize', function (e) {
+ 'xquery' === e.language && n(e.tokens);
});
})(Prism);