1-- This script processes the following source file:
3-- http://unicode.org/Public/UNIDATA/CaseFolding.txt
20 } deriving (Eq, Ord, Show)
22data CaseFolding = CF { cfComments :: [Comment], cfFolding :: [Fold] }
25entries :: Parser CaseFolding
26entries = CF <$> many comment <*> many (entry <* many comment)
28 entry = Fold <$> unichar <* semi
29 <*> oneOf "CFST" <* semi
31 <*> (string "# " *> manyTill anyToken (char '\n'))
33parseCF :: FilePath -> IO (Either ParseError CaseFolding)
34parseCF name = parse entries name <$> readFile name
36mapCF :: CaseFolding -> [String]
37mapCF (CF _ ms) = typ ++ (map nice . filter p $ ms) ++ [last]
39 typ = ["foldMapping :: forall s. Char -> s -> Step (CC s) Char"
40 ,"{-# NOINLINE foldMapping #-}"]
41 last = "foldMapping c s = Yield (toLower c) (CC s '\\0' '\\0')"
42 nice c = "-- " ++ name c ++ "\n" ++
43 "foldMapping " ++ showC (code c) ++ " s = Yield " ++ x ++ " (CC s " ++ y ++ " " ++ z ++ ")"
44 where [x,y,z] = (map showC . take 3) (mapping c ++ repeat '\0')
45 p f = status f `elem` "CF" &&
46 mapping f /= [toLower (code f)]
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list