function o(t,e,r){return e(r),r(t,e)}var p=/[a-z]/,m=/[A-Z]/,u=/[a-zA-Z0-9_]/,a=/[0-9]/,g=/[0-9A-Fa-f]/,f=/[-&*+.\\/<>=?^|:]/,x=/[(),[\]{}]/,k=/[ \v\f]/;function n(){return function(t,e){if(t.eatWhile(k))return null;var r=t.next();if(x.test(r))return r==="{"&&t.eat("-")?o(t,e,s(1)):r==="["&&t.match("glsl|")?o(t,e,T):"builtin";if(r==="'")return o(t,e,v);if(r==='"')return t.eat('"')?t.eat('"')?o(t,e,d):"string":o(t,e,h);if(m.test(r))return t.eatWhile(u),"type";if(p.test(r)){var i=t.pos===1;return t.eatWhile(u),i?"def":"variable"}if(a.test(r)){if(r==="0"){if(t.eat(/[xX]/))return t.eatWhile(g),"number"}else t.eatWhile(a);return t.eat(".")&&t.eatWhile(a),t.eat(/[eE]/)&&(t.eat(/[-+]/),t.eatWhile(a)),"number"}return f.test(r)?r==="-"&&t.eat("-")?(t.skipToEnd(),"comment"):(t.eatWhile(f),"keyword"):r==="_"?"keyword":"error"}}function s(t){return t==0?n():function(e,r){for(;!e.eol();){var i=e.next();if(i=="{"&&e.eat("-"))++t;else if(i=="-"&&e.eat("}")&&(--t,t===0))return r(n()),"comment"}return r(s(t)),"comment"}}function d(t,e){for(;!t.eol();)if(t.next()==='"'&&t.eat('"')&&t.eat('"'))return e(n()),"string";return"string"}function h(t,e){for(;t.skipTo('\\"');)t.next(),t.next();return t.skipTo('"')?(t.next(),e(n()),"string"):(t.skipToEnd(),e(n()),"error")}function v(t,e){for(;t.skipTo("\\'");)t.next(),t.next();return t.skipTo("'")?(t.next(),e(n()),"string"):(t.skipToEnd(),e(n()),"error")}function T(t,e){for(;!t.eol();)if(t.next()==="|"&&t.eat("]"))return e(n()),"string";return"string"}var W={case:1,of:1,as:1,if:1,then:1,else:1,let:1,in:1,type:1,alias:1,module:1,where:1,import:1,exposing:1,port:1};const y={name:"elm",startState:function(){return{f:n()}},copyState:function(t){return{f:t.f}},token:function(t,e){var r=e.f(t,function(c){e.f=c}),i=t.current();return W.hasOwnProperty(i)?"keyword":r},languageData:{commentTokens:{line:"--"}}};export{y as t};
