@@ -64,7 +64,15 @@
64-- Set VTY_DEBUG_LOG. Run vty. Check debug log for incorrect mappings. Add corrected mappings to
64-- Set VTY_DEBUG_LOG. Run vty. Check debug log for incorrect mappings. Add corrected mappings to
65-- .vty/config
65-- .vty/config
67−module Graphics.Vty.Config where
67+module Graphics.Vty.Config
69#if __GLASGOW_HASKELL__ > 704
77#if __GLASGOW_HASKELL__ > 704
70import Prelude
78import Prelude
@@ -182,14 +190,16 @@ parseConfigFile path = do
182 catch (runParseConfig path <$> BS.readFile path)
190 catch (runParseConfig path <$> BS.readFile path)
183 (\(_ :: IOException) -> return def)
191 (\(_ :: IOException) -> return def)
185−type Parser = Parsec BS.ByteString ()
187runParseConfig :: String -> BS.ByteString -> Config
193runParseConfig :: String -> BS.ByteString -> Config
188runParseConfig name cfgTxt =
194runParseConfig name cfgTxt =
189 case runParser parseConfig () name cfgTxt of
195 case runParser parseConfig () name cfgTxt of
190 Right cfg -> cfg
196 Right cfg -> cfg
191 Left{} -> def
197 Left{} -> def
199+------------------------------------------------------------------------
201+type Parser = Parsec BS.ByteString ()
193-- I tried to use the haskellStyle here but that was specialized (without requirement?) to the
203-- I tried to use the haskellStyle here but that was specialized (without requirement?) to the
194-- String stream type.
204-- String stream type.
195configLanguage :: Monad m => P.GenLanguageDef BS.ByteString () m
205configLanguage :: Monad m => P.GenLanguageDef BS.ByteString () m