!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("solr",function(){var o=/[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\"\\]/,r=/[\|\!\+\-\*\?\~\^\&]/,i=/^(OR|AND|NOT|TO)$/i;function u(r){return function(e,t){for(var n=r;(r=e.peek())&&null!=r.match(o);)n+=e.next();return t.tokenize=f,i.test(n)?"operator":function(e){return parseFloat(e).toString()===e}(n)?"number":":"==e.peek()?"field":"string"}}function f(e,t){var n=e.next();return'"'==n?t.tokenize=function(o){return function(e,t){for(var n,r=!1;null!=(n=e.next())&&(n!=o||r);)r=!r&&"\\"==n;return r||(t.tokenize=f),"string"}}(n):r.test(n)?t.tokenize=function(r){return function(e,t){var n="operator";return"+"==r?n+=" positive":"-"==r?n+=" negative":"|"==r?e.eat(/\|/):"&"==r?e.eat(/\&/):"^"==r&&(n+=" boost"),t.tokenize=f,n}}(n):o.test(n)&&(t.tokenize=u(n)),t.tokenize!=f?t.tokenize(e,t):null}return{startState:function(){return{tokenize:f}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)}}}),e.defineMIME("text/x-solr","solr")});