var e=function(){function e(e){return{type:e,style:"keyword"}}for(var t=e("operator"),n={type:"atom",style:"atom"},r={type:"axis_specifier",style:"qualifier"},a={",":{type:"punctuation",style:null}},i=["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"],s=0,o=i.length;s",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"];for(s=0,o=u.length;s\"\'\/?]/);)b+=k;return t(f,x,function(e,t){return function(r,a){return r.eatSpace(),t&&r.eat(">")?(g(a),a.tokenize=n,"tag"):(r.eat("/")||p(a,{type:"tag",name:e,tokenize:n}),r.eat(">")?(a.tokenize=n,"tag"):(a.tokenize=s,"tag"))}}(b,v))}if("{"==d)return p(x,{type:"codeblock"}),null;if("}"==d)return g(x),null;if(l(x))return">"==d?"tag":"/"==d&&f.eat(">")?(g(x),"tag"):"variable";if(/\d/.test(d))return f.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),"atom";if("("===d&&f.eat(":"))return p(x,{type:"comment"}),t(f,x,r);if(h||'"'!==d&&"'"!==d){if("$"===d)return t(f,x,i);if(":"===d&&f.eat("="))return"keyword";if("("===d)return p(x,{type:"paren"}),null;if(")"===d)return g(x),null;if("["===d)return p(x,{type:"bracket"}),null;if("]"===d)return g(x),null;var z=e.propertyIsEnumerable(d)&&e[d];if(h&&'"'===d)for(;'"'!==f.next(););if(h&&"'"===d)for(;"'"!==f.next(););z||f.eatWhile(/[\w\$_-]/);var w=f.eat(":");!f.eat(":")&&w&&f.eatWhile(/[\w\$_-]/),f.match(/^[ \t]*\(/,!1)&&(y=!0);var I=f.current();return z=e.propertyIsEnumerable(I)&&e[I],y&&!z&&(z={type:"function_call",style:"def"}),function(e){return m(e,"xmlconstructor")}(x)?(g(x),"variable"):("element"!=I&&"attribute"!=I&&"axis_specifier"!=z.type||p(x,{type:"xmlconstructor"}),z?z.style:"variable")}return t(f,x,a(d))}function r(e,t){for(var n,r=!1,a=!1,i=0;n=e.next();){if(")"==n&&r){if(!(i>0)){g(t);break}i--}else":"==n&&a&&i++;r=":"==n,a="("==n}return"comment"}function a(e,t){return function(r,i){var s;if(function(e){return m(e,"string")}(i)&&r.current()==e)return g(i),t&&(i.tokenize=t),"string";if(p(i,{type:"string",name:e,tokenize:a(e,t)}),r.match("{",!1)&&f(i))return i.tokenize=n,"string";for(;s=r.next();){if(s==e){g(i),t&&(i.tokenize=t);break}if(r.match("{",!1)&&f(i))return i.tokenize=n,"string"}return"string"}}function i(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,r){var i=e.next();return"/"==i&&e.eat(">")?(f(r)&&g(r),l(r)&&g(r),"tag"):">"==i?(f(r)&&g(r),"tag"):"="==i?null:'"'==i||"'"==i?t(e,r,a(i,s)):(f(r)||p(r,{type:"attribute",tokenize:s}),e.eat(/[a-zA-Z_:]/),e.eatWhile(/[-a-zA-Z0-9_:.]/),e.eatSpace(),(e.match(">",!1)||e.match("/",!1))&&(g(r),r.tokenize=n),"attribute")}function o(e,t){for(var r;r=e.next();)if("-"==r&&e.match("->",!0))return t.tokenize=n,"comment"}function c(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,"processingInstruction"}function l(e){return m(e,"tag")}function f(e){return m(e,"attribute")}function m(e,t){return e.stack.length&&e.stack[e.stack.length-1].type==t}function p(e,t){e.stack.push(t)}function g(e){e.stack.pop();var t=e.stack.length&&e.stack[e.stack.length-1].tokenize;e.tokenize=t||n}const x={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{x as xQuery};