Support preservation of capitalization in error messages
Getty Ritter
8 years ago
44 | 44 | |
45 | 45 | pIni :: Parser Ini |
46 | 46 | pIni = sBlanks *> (go `fmap` (many (pSection <?> "section") <* eof)) |
47 |
where go vs = Ini |
|
47 | where go vs = Ini $ HM.fromList [ (T.toLower (isName v), v) | |
48 | | v <- vs | |
49 | ] | |
48 | 50 | |
49 | 51 | sBlanks :: Parser () |
50 | 52 | sBlanks = skipMany (void eol <|> sComment) |
65 | 67 | end <- getCurrentLine |
66 | 68 | sBlanks |
67 | 69 | return IniSection |
68 |
{ isName = T. |
|
70 | { isName = T.strip name | |
69 | 71 | , isVals = HM.fromList [ (vName v, v) | v <- vals ] |
70 | 72 | , isStartLine = start |
71 | 73 | , isEndLine = end |