1-- This script processes the following source file:
3-- http://unicode.org/Public/UNIDATA/SpecialCasing.txt
19 , conditions :: String
21 } deriving (Eq, Ord, Show)
23entries :: Parser [Case]
24entries = many comment *> many (entry <* many comment)
26 entry = Case <$> unichar <* semi
30 <*> manyTill anyToken (string "# ")
31 <*> manyTill anyToken (char '\n')
33parseSC :: FilePath -> IO (Either ParseError [Case])
34parseSC name = parse entries name <$> readFile name
36mapSC :: String -> (Case -> String) -> (Char -> Char) -> [Case] -> [String]
37mapSC which access twiddle ms = typ ++ (map nice . filter p $ ms) ++ [last]
39 typ = [which ++ "Mapping :: forall s. Char -> s -> Step (CC s) Char"
40 ,"{-# INLINE " ++ which ++ "Mapping #-}"]
41 last = which ++ "Mapping c s = Yield (to" ++ ucFirst which ++ " c) (CC s '\\0' '\\0')"
42 nice c = "-- " ++ name c ++ "\n" ++
43 which ++ "Mapping " ++ showC (code c) ++ " s = Yield " ++ x ++ " (CC s " ++ y ++ " " ++ z ++ ")"
44 where [x,y,z] = (map showC . take 3) (access c ++ repeat '\0')
45 p c = [k] /= a && a /= [twiddle k] && null (conditions c)
49ucFirst (c:cs) = toUpper c : cs
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