1(function(a){if(typeof exports=="object"&&typeof module=="object")a(require("../../lib/codemirror"));else if(typeof define=="function"&&define.amd)define(["../../lib/codemirror"],a);else a(CodeMirror)})(function(a){"use strict";a.defineMode("xquery",function(){var a=function(){function a(a){return{type:a,style:"keyword"}}var b=a("operator"),c={type:"atom",style:"atom"},d={type:"punctuation",style:null},e={type:"axis_specifier",style:"qualifier"};var f={",":d};var g=["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"];for(var h=0,i=g.length;h<i;h++){f[g[h]]=a(g[h])}var j=["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"];for(var h=0,i=j.length;h<i;h++){f[j[h]]=c}var k=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"];for(var h=0,i=k.length;h<i;h++){f[k[h]]=b}var l=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"];for(var h=0,i=l.length;h<i;h++){f[l[h]]=e}return f}();function b(a,b,c){b.tokenize=c;return c(a,b)}function c(c,h){var m=c.next(),o=false,q=p(c);if(m=="<"){if(c.match("!--",true))return b(c,h,i);if(c.match("![CDATA",false)){h.tokenize=j;return"tag"}if(c.match("?",false)){return b(c,h,k)}var t=c.eat("/");c.eatSpace();var u="",v;while(v=c.eat(/[^\s\u00a0=<>\"\'\/?]/))u+=v;return b(c,h,g(u,t))}else if(m=="{"){r(h,{type:"codeblock"});return null}else if(m=="}"){s(h);return null}else if(l(h)){if(m==">")return"tag";else if(m=="/"&&c.eat(">")){s(h);return"tag"}else return"variable"}else if(/\d/.test(m)){c.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/);return"atom"}else if(m==="("&&c.eat(":")){r(h,{type:"comment"});return b(c,h,d)}else if(!q&&(m==='"'||m==="'"))return b(c,h,e(m));else if(m==="$"){return b(c,h,f)}else if(m===":"&&c.eat("=")){return"keyword"}else if(m==="("){r(h,{type:"paren"});return null}else if(m===")"){s(h);return null}else if(m==="["){r(h,{type:"bracket"});return null}else if(m==="]"){s(h);return null}else{var w=a.propertyIsEnumerable(m)&&a[m];if(q&&m==='"')while(c.next()!=='"'){}if(q&&m==="'")while(c.next()!=="'"){}if(!w)c.eatWhile(/[\w\$_-]/);var x=c.eat(":");if(!c.eat(":")&&x){c.eatWhile(/[\w\$_-]/)}if(c.match(/^[ \t]*\(/,false)){o=true}var y=c.current();w=a.propertyIsEnumerable(y)&&a[y];if(o&&!w)w={type:"function_call",style:"variable def"};if(n(h)){s(h);return"variable"}if(y=="element"||y=="attribute"||w.type=="axis_specifier")r(h,{type:"xmlconstructor"});return w?w.style:"variable"}}function d(a,b){var c=false,d=false,e=0,f;while(f=a.next()){if(f==")"&&c){if(e>0)e--;else{s(b);break}}else if(f==":"&&d){e++}c=f==":";d=f=="("}return"comment"}function e(a,b){return function(d,f){var g;if(o(f)&&d.current()==a){s(f);if(b)f.tokenize=b;return"string"}r(f,{type:"string",name:a,tokenize:e(a,b)});if(d.match("{",false)&&m(f)){f.tokenize=c;return"string"}while(g=d.next()){if(g==a){s(f);if(b)f.tokenize=b;break}else{if(d.match("{",false)&&m(f)){f.tokenize=c;return"string"}}}return"string"}}function f(a,b){var d=/[\w\$_-]/;if(a.eat('"')){while(a.next()!=='"'){}a.eat(":")}else{a.eatWhile(d);if(!a.match(":=",false))a.eat(":")}a.eatWhile(d);b.tokenize=c;return"variable"}function g(a,b){return function(d,e){d.eatSpace();if(b&&d.eat(">")){s(e);e.tokenize=c;return"tag"}if(!d.eat("/"))r(e,{type:"tag",name:a,tokenize:c});if(!d.eat(">")){e.tokenize=h;return"tag"}else{e.tokenize=c}return"tag"}}function h(a,d){var f=a.next();if(f=="/"&&a.eat(">")){if(m(d))s(d);if(l(d))s(d);return"tag"}if(f==">"){if(m(d))s(d);return"tag"}if(f=="=")return null;if(f=='"'||f=="'")return b(a,d,e(f,h));if(!m(d))r(d,{type:"attribute",tokenize:h});a.eat(/[a-zA-Z_:]/);a.eatWhile(/[-a-zA-Z0-9_:.]/);a.eatSpace();if(a.match(">",false)||a.match("/",false)){s(d);d.tokenize=c}return"attribute"}function i(a,b){var d;while(d=a.next()){if(d=="-"&&a.match("->",true)){b.tokenize=c;return"comment"}}}function j(a,b){var d;while(d=a.next()){if(d=="]"&&a.match("]",true)){b.tokenize=c;return"comment"}}}function k(a,b){var d;while(d=a.next()){if(d=="?"&&a.match(">",true)){b.tokenize=c;return"comment meta"}}}function l(a){return q(a,"tag")}function m(a){return q(a,"attribute")}function n(a){return q(a,"xmlconstructor")}function o(a){return q(a,"string")}function p(a){if(a.current()==='"')return a.match(/^[^\"]+\"\:/,false);else if(a.current()==="'")return a.match(/^[^\"]+\'\:/,false);else return false}function q(a,b){return a.stack.length&&a.stack[a.stack.length-1].type==b}function r(a,b){a.stack.push(b)}function s(a){a.stack.pop();var b=a.stack.length&&a.stack[a.stack.length-1].tokenize;a.tokenize=b||c}return{startState:function(){return{tokenize:c,cc:[],stack:[]}},token:function(a,b){if(a.eatSpace())return null;var c=b.tokenize(a,b);return c},blockCommentStart:"(:",blockCommentEnd:":)"}});a.defineMIME("application/xquery","xquery")});
2//# sourceMappingURL=xquery.min.js.map