diff options
author | jao <jao@gnu.org> | 2018-11-25 04:26:10 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2018-11-25 04:44:25 +0000 |
commit | cce2298c43759ee4aa314f07e5f6e8a71a38bf64 (patch) | |
tree | 9df81a075a322362ca420a43d72950f218c0c1f8 /src/lib | |
parent | c27d32ea89dfd2ad07ecc73cfdd17f3935c74aaa (diff) | |
download | xmobar-cce2298c43759ee4aa314f07e5f6e8a71a38bf64.tar.gz xmobar-cce2298c43759ee4aa314f07e5f6e8a71a38bf64.tar.bz2 |
Whitespace
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Xmobar/Parsers.hs | 12 | ||||
-rw-r--r-- | src/lib/Xmobar/X11/ColorCache.hs | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/Xmobar/Parsers.hs b/src/lib/Xmobar/Parsers.hs index 33afd09..b7e4dbd 100644 --- a/src/lib/Xmobar/Parsers.hs +++ b/src/lib/Xmobar/Parsers.hs @@ -36,7 +36,8 @@ type ColorString = String type FontIndex = Int -- | Runs the string parser -parseString :: Config -> String -> IO [(Widget, ColorString, FontIndex, Maybe [Action])] +parseString :: Config -> String + -> IO [(Widget, ColorString, FontIndex, Maybe [Action])] parseString c s = case parse (stringParser (fgColor c) 0 Nothing) "" s of Left _ -> return [(Text $ "Could not parse string: " ++ s @@ -114,7 +115,8 @@ iconParser c f a = do i <- manyTill (noneOf ">") (try (string "/>")) return [(Icon i, c, f, a)] -actionParser :: String -> FontIndex -> Maybe [Action] -> Parser [(Widget, ColorString, FontIndex, Maybe [Action])] +actionParser :: String -> FontIndex -> Maybe [Action] + -> Parser [(Widget, ColorString, FontIndex, Maybe [Action])] actionParser c f act = do string "<action=" command <- choice [between (char '`') (char '`') (many1 (noneOf "`")), @@ -132,14 +134,16 @@ toButtons :: String -> [Button] toButtons = map (\x -> read [x]) -- | Parsers a string wrapped in a color specification. -colorParser :: FontIndex -> Maybe [Action] -> Parser [(Widget, ColorString, FontIndex, Maybe [Action])] +colorParser :: FontIndex -> Maybe [Action] + -> Parser [(Widget, ColorString, FontIndex, Maybe [Action])] colorParser f a = do c <- between (string "<fc=") (string ">") colors s <- manyTill (allParsers c f a) (try $ string "</fc>") return (concat s) -- | Parsers a string wrapped in a font specification. -fontParser :: ColorString -> Maybe [Action] -> Parser [(Widget, ColorString, FontIndex, Maybe [Action])] +fontParser :: ColorString -> Maybe [Action] + -> Parser [(Widget, ColorString, FontIndex, Maybe [Action])] fontParser c a = do f <- between (string "<fn=") (string ">") colors s <- manyTill (allParsers c (read f) a) (try $ string "</fn>") diff --git a/src/lib/Xmobar/X11/ColorCache.hs b/src/lib/Xmobar/X11/ColorCache.hs index c5e8823..4d22e16 100644 --- a/src/lib/Xmobar/X11/ColorCache.hs +++ b/src/lib/Xmobar/X11/ColorCache.hs @@ -22,7 +22,8 @@ module Xmobar.X11.ColorCache(withColors, withDrawingColors) where import Xmobar.X11.MinXft #else -module Xmobar.X11., 2018ColorCache(withColors) where + +module Xmobar.X11.ColorCache(withColors) where #endif |