Warning, /frameworks/syntax-highlighting/autotests/input/highlight.lhs is written in an unsupported language. File is not indexed.
0001 test file for Haskell syntax highlighting in KDE's Kate
0002
0003 The test file for literate Haskell can be easily created like this:
0004 cat highlight.hs | sed -e "s|^|> |" -e "s|> -- ||" -e "s|^> $||" > highlight.lhs
0005 You only have to manually edit the multi-line comment below.
0006
0007 this is a single-line comment
0008
0009 {- this is a multi-line comment
0010
0011 Things like "a string" or a 'c' character shouldn't be highlighted in here.
0012
0013 I could even start a new
0014 one-line comment.
0015
0016 -}
0017
0018 a data definition
0019
0020 > data Tree a = Br (Tree a) (Tree a) | Leaf a | Nil deriving (Show, Eq)
0021
0022
0023 function definition, "funnyfunction::", "Integer", "Int", "Bool" should be highlighted
0024
0025 > funnyfunction::(Tree a)=>[a]->Integer->Int->Bool
0026
0027
0028 strings and chars
0029 first line of function definitions (type declaration) should be highlighted
0030
0031 > strangefunction::Int->String
0032 > strangefunction 1 = "hello"
0033 > strangefunction 2 = "what's up"
0034 > strangefunction 3 = (strangefunction 1) ++ ", " ++ (strangefunction 2)
0035 > strangefunction 4 = 'a':'b':'c':'"':[] -- will return "abc"
0036 > strangefunction 5 = '\n':[]
0037 > strangefunction 6 = '\invalidhaskell':[]
0038
0039 function name including the single quote character
0040 and infix operator (`div`)
0041
0042 > justtesting'::Int->Int
0043 > justtesting' 2 = 2+1
0044 > justtesting' 9 = 7 `div` 2
0045
0046 same definition as above, slightly different function name and a couple more whitespaces
0047
0048 > justtesting'' :: Int -> Int
0049 > justtesting'' 2 = 3
0050 > justtesting'' 9 = 3 + 9 - 9
0051
0052 the following lines are copied out of Haskell's "Prelude.hs"
0053
0054 > infixl 7 *, /, `quot`, `rem`, `div`, `mod`, :%, %
0055
0056
0057 everything highlighted except the "a"
0058
0059 > class Bounded a where
0060 > minBound, maxBound :: a
0061
0062 > class (Num a, Ord a) => Real a where
0063 > toRational :: a -> Rational
0064
0065 finally, some keyword lists
0066
0067 keywords
0068
0069 > case, class, data, deriving, do, else, if, in, infixl, infixr, instance, let, module, of, primitive,
0070 > then, type, where
0071
0072 infix operators
0073
0074 > quot, rem, div, mod, elem, notElem, seq
0075
0076 this stuff is not handled yet
0077
0078 > !!, %, &&, $!, $, *, **, -,., /=, <, <=, =<<, ==, >, >=, >>, >>=, ^, ^^, ++, ||
0079
0080 functions
0081
0082 > FilePath, IOError, abs, acos, acosh, all, and, any, appendFile,
0083 > approxRational, asTypeOf, asin, asinh, atan, atan2, atanh, basicIORun,
0084 > break, catch, ceiling, chr, compare, concat, concatMap, const, cos, cosh,
0085 > curry, cycle, decodeFloat, denominator, digitToInt, div, divMod, drop,
0086 > dropWhile, either, elem, encodeFloat, enumFrom, enumFromThen,
0087 > enumFromThenTo, enumFromTo, error, even, exp, exponent, fail, filter, flip,
0088 > floatDigits, floatRadix, floatRange, floor, fmap, foldl, foldl1, foldr,
0089 > foldr1, fromDouble, fromEnum, fromInt, fromInteger, fromIntegral,
0090 > fromRational, fst, gcd, getChar, getContents, getLine, head, id, inRange,
0091 > index, init, intToDigit, interact, ioError, isAlpha, isAlphaNum, isAscii,
0092 > isControl, isDenormalized, isDigit, isHexDigit, isIEEE, isInfinite, isLower,
0093 > isNaN, isNegativeZero, isOctDigit, isPrint, isSpace, isUpper, iterate, last,
0094 > lcm, length, lex, lexDigits, lexLitChar, lines, log, logBase, lookup, map,
0095 > mapM, mapM_, max, maxBound, maximum, maybe, min, minBound, minimum, mod,
0096 > negate, not, notElem, null, numerator, odd, or, ord, otherwise, pi, pred,
0097 > primExitWith, print, product, properFraction, putChar, putStr, putStrLn,
0098 > quot, quotRem, range, rangeSize, read, readDec, readFile, readFloat,
0099 > readHex, readIO, readInt, readList, readLitChar, readLn, readOct, readParen,
0100 > readSigned, reads, readsPrec, realToFrac, recip, rem, repeat, replicate,
0101 > return, reverse, round, scaleFloat, scanl, scanl1, scanr, scanr1, seq,
0102 > sequence, sequence_, show, showChar, showInt, showList, showLitChar,
0103 > showParen, showSigned, showString, shows, showsPrec, significand, signum,
0104 > sin, sinh, snd, span, splitAt, sqrt, subtract, succ, sum, tail, take,
0105 > either, elem, encodeFloat, enumFrom, enumFromThen, enumFromThenTo,
0106 > enumFromTo, error, even, exp, exponent, fail, filter, flip, floatDigits,
0107 > floatRadix, floatRange, floor, fmap, takeWhile, tan, tanh, threadToIOResult,
0108 > toEnum, toInt, toInteger, toLower, toRational, toUpper, truncate, uncurry,
0109 > undefined, unlines, until, unwords, unzip, unzip3, userError, words,
0110 > writeFile, zip, zip3, zipWith, zipWith3
0111
0112 type constructors
0113
0114 > Bool, Char, Double, Either, Float, IO, Integer, Int, Maybe, Ordering, Rational, Ratio, ReadS,
0115 > ShowS, String
0116
0117 classes
0118
0119 > Bounded, Enum, Eq, Floating, Fractional, Functor, Integral, Ix, Monad, Num, Ord, Read, RealFloat,
0120 > RealFrac, Real, Show
0121
0122 data constructors
0123
0124 > EQ, False, GT, Just, LT, Left, Nothing, Right, True