var isStringChar=/[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\"\\]/,isOperatorChar=/[\|\!\+\-\*\?\~\^\&]/,isOperatorString=/^(OR|AND|NOT|TO)$/i;function isNumber(t){return parseFloat(t).toString()===t}function tokenString(t){return function(e,n){for(var r,o=!1;null!=(r=e.next())&&(r!=t||o);)o=!o&&"\\"==r;return o||(n.tokenize=tokenBase),"string"}}function tokenOperator(t){return function(e,n){return "|"==t?e.eat(/\|/):"&"==t&&e.eat(/\&/),n.tokenize=tokenBase,"operator"}}function tokenWord(t){return function(e,n){for(var r=t;(t=e.peek())&&null!=t.match(isStringChar);)r+=e.next();return n.tokenize=tokenBase,isOperatorString.test(r)?"operator":isNumber(r)?"number":":"==e.peek()?"propertyName":"string"}}function tokenBase(t,e){var n=t.next();return '"'==n?e.tokenize=tokenString(n):isOperatorChar.test(n)?e.tokenize=tokenOperator(n):isStringChar.test(n)&&(e.tokenize=tokenWord(n)),e.tokenize!=tokenBase?e.tokenize(t,e):null}const solr={startState:function(){return {tokenize:tokenBase}},token:function(t,e){return t.eatSpace()?null:e.tokenize(t,e)}};

export { solr };
