Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (24 sloc) 2.92 KB
# haskell.lang Copyright (c) 2010 Nicolas Wu
number =
'\<[+-]?((0x[[:xdigit:]]+)|(0[oO][0-7]+)|(([[:digit:]]*\.)?
[[:digit:]]+([eE][+-]?[[:digit:]]+)?))u?((int(?:8|16|32|64))|L)?\>'
# strings and chars (including non-control escapes)
string delim "\"" "\"" escape "\\" multiline
string = '\'([^\\\']{1}|\\[\\\'0abfnrtv"&]|\\[[:digit:]]+|\\[oO][0-7]+|\\[xX][[:xdigit:]]+)\''
keyword = '\<(as|case|class|data|deriving|do|else|hiding|if|import|in|infixl|infixr|instance|let|module|newtype|of|primitive|qualified|then|type|where|_)\>'
predef_func = '\<(abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|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|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\>'
predef_var = '\<(False|True|Left|Right|Just|Nothing|EQ|LT|GT)\>'
classname = '\<(Bounded|Enum|Eq|Floating|Fractional|Functor|Integral|Ix|Monad|Num|Ord|Read|Real|RealFloat|RealFrac|Show)\>'
preproc delim "{-#" "#-}" multiline
vardef SYMBOL = '[!#\$%&\*\+\./<=>\?@\\\^\|\-~:]'
comment delim "{-" "-}" multiline nested
comment start '(--)(?!' + $SYMBOL + ')'
comment = '^>(?= )'
specialchar = '(\.\.|:|::|=|\\|\||<\-|\->|@|~|=>)(?!' + $SYMBOL + ')'
specialchar = "∷|⇒|→|←|∀|∃"
symbol = $SYMBOL + '+'
symbol = "≤|≥|≠|≡|⇐|⧺"
symbol = '`\w+`'
type = '\<(Bool|Char|Double|Either|FilePath|Float|Int|Integer|IO|IOError|Maybe|Ordering|Ratio|Rational|ReadS|ShowS|String|ByteString)\>'
usertype = '\<(?:[A-Z][\w\']*)\>(?![\.])'
cbracket = "{|}|[|]"