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