gdritter repos config-ini / e8b5c4b
Support preservation of capitalization in error messages Getty Ritter 8 years ago
1 changed file(s) with 4 addition(s) and 2 deletion(s). Collapse all Expand all
4444
4545 pIni :: Parser Ini
4646 pIni = sBlanks *> (go `fmap` (many (pSection <?> "section") <* eof))
47 where go vs = Ini (HM.fromList [ (isName v, v) | v <- vs ])
47 where go vs = Ini $ HM.fromList [ (T.toLower (isName v), v)
48 | v <- vs
49 ]
4850
4951 sBlanks :: Parser ()
5052 sBlanks = skipMany (void eol <|> sComment)
6567 end <- getCurrentLine
6668 sBlanks
6769 return IniSection
68 { isName = T.toLower (T.strip name)
70 { isName = T.strip name
6971 , isVals = HM.fromList [ (vName v, v) | v <- vals ]
7072 , isStartLine = start
7173 , isEndLine = end