summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/Xmobar/Parsers.hs12
-rw-r--r--src/lib/Xmobar/X11/ColorCache.hs3
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