4import System.Environment
5import Control.Applicative hiding (many)
9main = (head <$> getArgs) >>= parseUnicodeMapping
12parseUnicodeMapping :: FilePath -> IO ()
13parseUnicodeMapping fname = do
15 let mapname = dropExtension . takeFileName $ fname
16 let res = runParse fin
17 let header = "-- Generated from " ++ fname ++ "\n" ++
18 mapname ++ " :: [(Char, Char)]\n" ++ mapname ++" =\n [ "
20 writeFile (replaceExtension fname ".hs")
21 (header ++ (concat $ intersperse "\n , " (map show res)) ++ footer)
25runParse :: String -> [(Char, Unicode)]
26runParse s= either (error . show) id (parse parseMap "" s)
28anyline = manyTill anyChar newline
30getHexChar :: Parsec String () Char
32 [(c,_)] <- readLitChar . ("\\x" ++) <$> many1 hexDigit
35parseMap :: Parsec String () [(Char, Unicode)]
37 skipMany (char '#' >> anyline)
38 many (flip (,) <$> getHexChar <* tab <*> getHexChar <* anyline)
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