!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("haskell",function(e,i){function a(e,r,t){return r(t),t(e,r)}var o=/[a-z_]/,l=/[A-Z]/,u=/\d/,f=/[0-9A-Fa-f]/,s=/[0-7]/,c=/[a-z_A-Z0-9'\xa1-\uffff]/,d=/[-!#$%&*+.\/<=>?@\\^|~:]/,m=/[(),;[\]`{}]/,h=/[ \t\v\f]/;function p(e,r){if(e.eatWhile(h))return null;var t=e.next();if(m.test(t)){if("{"==t&&e.eat("-")){var n="comment";return e.eat("#")&&(n="meta"),a(e,r,function i(a,o){if(0==o)return p;return function(e,r){for(var t=o;!e.eol();){var n=e.next();if("{"==n&&e.eat("-"))++t;else if("-"==n&&e.eat("}")&&0==--t)return r(p),a}return r(i(a,t)),a}}(n,1))}return null}if("'"==t)return e.eat("\\"),e.next(),e.eat("'")?"string":"string error";if('"'==t)return a(e,r,g);if(l.test(t))return e.eatWhile(c),e.eat(".")?"qualifier":"variable-2";if(o.test(t))return e.eatWhile(c),"variable";if(u.test(t)){if("0"==t){if(e.eat(/[xX]/))return e.eatWhile(f),"integer";if(e.eat(/[oO]/))return e.eatWhile(s),"number"}e.eatWhile(u);n="number";return e.match(/^\.\d+/)&&(n="number"),e.eat(/[eE]/)&&(n="number",e.eat(/[-+]/),e.eatWhile(u)),n}if("."==t&&e.eat("."))return"keyword";if(d.test(t)){if("-"==t&&e.eat(/-/)&&(e.eatWhile(/-/),!e.eat(d)))return e.skipToEnd(),"comment";n="variable";return":"==t&&(n="variable-2"),e.eatWhile(d),n}return"error"}function g(e,r){for(;!e.eol();){var t=e.next();if('"'==t)return r(p),"string";if("\\"==t){if(e.eol()||e.eat(h))return r(n),"string";e.eat("&")||e.next()}}return r(p),"string error"}function n(e,r){return e.eat("\\")?a(e,r,g):(e.next(),r(p),"error")}var v=function(){var t={};function e(r){return function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=r}}e("keyword")("case","class","data","default","deriving","do","else","foreign","if","import","in","infix","infixl","infixr","instance","let","module","newtype","of","then","type","where","_"),e("keyword")("..",":","::","=","\\","<-","->","@","~","=>"),e("builtin")("!!","$!","$","&&","+","++","-",".","/","/=","<","<*","<=","<$>","<*>","=<<","==",">",">=",">>",">>=","^","^^","||","*","*>","**"),e("builtin")("Applicative","Bool","Bounded","Char","Double","EQ","Either","Enum","Eq","False","FilePath","Float","Floating","Fractional","Functor","GT","IO","IOError","Int","Integer","Integral","Just","LT","Left","Maybe","Monad","Nothing","Num","Ord","Ordering","Rational","Read","ReadS","Real","RealFloat","RealFrac","Right","Show","ShowS","String","True"),e("builtin")("abs","acos","acosh","all","and","any","appendFile","asTypeOf","asin","asinh","atan","atan2","atanh","break","catch","ceiling","compare","concat","concatMap","const","cos","cosh","curry","cycle","decodeFloat","div","divMod","drop","dropWhile","either","elem","encodeFloat","enumFrom","enumFromThen","enumFromThenTo","enumFromTo","error","even","exp","exponent","fail","filter","flip","floatDigits","floatRadix","floatRange","floor","fmap","foldl","foldl1","foldr","foldr1","fromEnum","fromInteger","fromIntegral","fromRational","fst","gcd","getChar","getContents","getLine","head","id","init","interact","ioError","isDenormalized","isIEEE","isInfinite","isNaN","isNegativeZero","iterate","last","lcm","length","lex","lines","log","logBase","lookup","map","mapM","mapM_","max","maxBound","maximum","maybe","min","minBound","minimum","mod","negate","not","notElem","null","odd","or","otherwise","pi","pred","print","product","properFraction","pure","putChar","putStr","putStrLn","quot","quotRem","read","readFile","readIO","readList","readLn","readParen","reads","readsPrec","realToFrac","recip","rem","repeat","replicate","return","reverse","round","scaleFloat","scanl","scanl1","scanr","scanr1","seq","sequence","sequence_","show","showChar","showList","showParen","showString","shows","showsPrec","significand","signum","sin","sinh","snd","span","splitAt","sqrt","subtract","succ","sum","tail","take","takeWhile","tan","tanh","toEnum","toInteger","toRational","truncate","uncurry","undefined","unlines","until","unwords","unzip","unzip3","userError","words","writeFile","zip","zip3","zipWith","zipWith3");var r=i.overrideKeywords;if(r)for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n]);return t}();return{startState:function(){return{f:p}},copyState:function(e){return{f:e.f}},token:function(e,r){var t=r.f(e,function(e){r.f=e}),n=e.current();return v.hasOwnProperty(n)?v[n]:t},blockCommentStart:"{-",blockCommentEnd:"-}",lineComment:"--"}}),e.defineMIME("text/x-haskell","haskell")});