Files
ijmuv-blog-release/frontend/assets/xquery-DZdYf9U3.js
2026-05-08 13:39:01 +08:00

1 line
6.1 KiB
JavaScript

var e=function(){function e(e){return{type:e,style:`keyword`}}for(var t=e(`operator`),n={type:`atom`,style:`atom`},r={type:`punctuation`,style:null},i={type:`axis_specifier`,style:`qualifier`},a={",":r},o=`after.all.allowing.ancestor.ancestor-or-self.any.array.as.ascending.at.attribute.base-uri.before.boundary-space.by.case.cast.castable.catch.child.collation.comment.construction.contains.content.context.copy.copy-namespaces.count.decimal-format.declare.default.delete.descendant.descendant-or-self.descending.diacritics.different.distance.document.document-node.element.else.empty.empty-sequence.encoding.end.entire.every.exactly.except.external.first.following.following-sibling.for.from.ftand.ftnot.ft-option.ftor.function.fuzzy.greatest.group.if.import.in.inherit.insensitive.insert.instance.intersect.into.invoke.is.item.language.last.lax.least.let.levels.lowercase.map.modify.module.most.namespace.next.no.node.nodes.no-inherit.no-preserve.not.occurs.of.only.option.order.ordered.ordering.paragraph.paragraphs.parent.phrase.preceding.preceding-sibling.preserve.previous.processing-instruction.relationship.rename.replace.return.revalidation.same.satisfies.schema.schema-attribute.schema-element.score.self.sensitive.sentence.sentences.sequence.skip.sliding.some.stable.start.stemming.stop.strict.strip.switch.text.then.thesaurus.times.to.transform.treat.try.tumbling.type.typeswitch.union.unordered.update.updating.uppercase.using.validate.value.variable.version.weight.when.where.wildcards.window.with.without.word.words.xquery`.split(`.`),s=0,c=o.length;s<c;s++)a[o[s]]=e(o[s]);for(var l=`xs:anyAtomicType.xs:anySimpleType.xs:anyType.xs:anyURI.xs:base64Binary.xs:boolean.xs:byte.xs:date.xs:dateTime.xs:dateTimeStamp.xs:dayTimeDuration.xs:decimal.xs:double.xs:duration.xs:ENTITIES.xs:ENTITY.xs:float.xs:gDay.xs:gMonth.xs:gMonthDay.xs:gYear.xs:gYearMonth.xs:hexBinary.xs:ID.xs:IDREF.xs:IDREFS.xs:int.xs:integer.xs:item.xs:java.xs:language.xs:long.xs:Name.xs:NCName.xs:negativeInteger.xs:NMTOKEN.xs:NMTOKENS.xs:nonNegativeInteger.xs:nonPositiveInteger.xs:normalizedString.xs:NOTATION.xs:numeric.xs:positiveInteger.xs:precisionDecimal.xs:QName.xs:short.xs:string.xs:time.xs:token.xs:unsignedByte.xs:unsignedInt.xs:unsignedLong.xs:unsignedShort.xs:untyped.xs:untypedAtomic.xs:yearMonthDuration`.split(`.`),s=0,c=l.length;s<c;s++)a[l[s]]=n;for(var u=[`eq`,`ne`,`lt`,`le`,`gt`,`ge`,`:=`,`=`,`>`,`>=`,`<`,`<=`,`.`,`|`,`?`,`and`,`or`,`div`,`idiv`,`mod`,`*`,`/`,`+`,`-`],s=0,c=u.length;s<c;s++)a[u[s]]=t;for(var d=[`self::`,`attribute::`,`child::`,`descendant::`,`descendant-or-self::`,`parent::`,`ancestor::`,`ancestor-or-self::`,`following::`,`preceding::`,`following-sibling::`,`preceding-sibling::`],s=0,c=d.length;s<c;s++)a[d[s]]=i;return a}();function t(e,t,n){return t.tokenize=n,n(e,t)}function n(n,i){var c=n.next(),p=!1,g=h(n);if(c==`<`){if(n.match(`!--`,!0))return t(n,i,l);if(n.match(`![CDATA`,!1))return i.tokenize=u,`tag`;if(n.match(`?`,!1))return t(n,i,d);var y=n.eat(`/`);n.eatSpace();for(var b=``,x;x=n.eat(/[^\s\u00a0=<>\"\'\/?]/);)b+=x;return t(n,i,s(b,y))}else if(c==`{`)return _(i,{type:`codeblock`}),null;else if(c==`}`)return v(i),null;else if(f(i))return c==`>`?`tag`:c==`/`&&n.eat(`>`)?(v(i),`tag`):`variable`;else if(/\d/.test(c))return n.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),`atom`;else if(c===`(`&&n.eat(`:`))return _(i,{type:`comment`}),t(n,i,r);else if(!g&&(c===`"`||c===`'`))return a(n,i,c);else if(c===`$`)return t(n,i,o);else if(c===`:`&&n.eat(`=`))return`keyword`;else if(c===`(`)return _(i,{type:`paren`}),null;else if(c===`)`)return v(i),null;else if(c===`[`)return _(i,{type:`bracket`}),null;else if(c===`]`)return v(i),null;else{var S=e.propertyIsEnumerable(c)&&e[c];if(g&&c===`"`)for(;n.next()!==`"`;);if(g&&c===`'`)for(;n.next()!==`'`;);S||n.eatWhile(/[\w\$_-]/);var C=n.eat(`:`);!n.eat(`:`)&&C&&n.eatWhile(/[\w\$_-]/),n.match(/^[ \t]*\(/,!1)&&(p=!0);var w=n.current();return S=e.propertyIsEnumerable(w)&&e[w],p&&!S&&(S={type:`function_call`,style:`def`}),m(i)?(v(i),`variable`):((w==`element`||w==`attribute`||S.type==`axis_specifier`)&&_(i,{type:`xmlconstructor`}),S?S.style:`variable`)}}function r(e,t){for(var n=!1,r=!1,i=0,a;a=e.next();){if(a==`)`&&n)if(i>0)i--;else{v(t);break}else a==`:`&&r&&i++;n=a==`:`,r=a==`(`}return`comment`}function i(e,t){return function(r,i){for(var a;a=r.next();)if(a==e){v(i),t&&(i.tokenize=t);break}else if(r.match(`{`,!1)&&p(i))return _(i,{type:`codeblock`}),i.tokenize=n,`string`;return`string`}}function a(e,n,r,a){let o=i(r,a);return _(n,{type:`string`,name:r,tokenize:o}),t(e,n,o)}function o(e,t){var r=/[\w\$_-]/;if(e.eat(`"`)){for(;e.next()!==`"`;);e.eat(`:`)}else e.eatWhile(r),e.match(`:=`,!1)||e.eat(`:`);return e.eatWhile(r),t.tokenize=n,`variable`}function s(e,t){return function(r,i){if(r.eatSpace(),t&&r.eat(`>`))return v(i),i.tokenize=n,`tag`;if(r.eat(`/`)||_(i,{type:`tag`,name:e,tokenize:n}),r.eat(`>`))i.tokenize=n;else return i.tokenize=c,`tag`;return`tag`}}function c(e,t){var r=e.next();return r==`/`&&e.eat(`>`)?(p(t)&&v(t),f(t)&&v(t),`tag`):r==`>`?(p(t)&&v(t),`tag`):r==`=`?null:r==`"`||r==`'`?a(e,t,r,c):(p(t)||_(t,{type:`attribute`,tokenize:c}),e.eat(/[a-zA-Z_:]/),e.eatWhile(/[-a-zA-Z0-9_:.]/),e.eatSpace(),(e.match(`>`,!1)||e.match(`/`,!1))&&(v(t),t.tokenize=n),`attribute`)}function l(e,t){for(var r;r=e.next();)if(r==`-`&&e.match(`->`,!0))return t.tokenize=n,`comment`}function u(e,t){for(var r;r=e.next();)if(r==`]`&&e.match(`]`,!0))return t.tokenize=n,`comment`}function d(e,t){for(var r;r=e.next();)if(r==`?`&&e.match(`>`,!0))return t.tokenize=n,`processingInstruction`}function f(e){return g(e,`tag`)}function p(e){return g(e,`attribute`)}function m(e){return g(e,`xmlconstructor`)}function h(e){return e.current()===`"`?e.match(/^[^\"]+\"\:/,!1):e.current()===`'`?e.match(/^[^\"]+\'\:/,!1):!1}function g(e,t){return e.stack.length&&e.stack[e.stack.length-1].type==t}function _(e,t){e.stack.push(t)}function v(e){e.stack.pop(),e.tokenize=e.stack.length&&e.stack[e.stack.length-1].tokenize||n}var y={name:`xquery`,startState:function(){return{tokenize:n,cc:[],stack:[]}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},languageData:{commentTokens:{block:{open:`(:`,close:`:)`}}}};export{y as xQuery};