From 97cf495c40c2b28aa292014b35161641c42d71b3 Mon Sep 17 00:00:00 2001 From: Alexander Polakov Date: Wed, 13 Mar 2013 21:01:15 +0400 Subject: Shorter lines --- src/Parsers.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Parsers.hs b/src/Parsers.hs index f3b0a2e..9faacb9 100644 --- a/src/Parsers.hs +++ b/src/Parsers.hs @@ -42,7 +42,8 @@ parseString c s = -- | Gets the string and combines the needed parsers stringParser :: String -> Maybe Action -> Parser [[(Widget, ColorString, Maybe Action)]] -stringParser c a = manyTill (textParser c a <|> try (iconParser c a) <|> try (actionParser c) <|> colorParser a) eof +stringParser c a = manyTill (textParser c a <|> try (iconParser c a) <|> + try (actionParser c) <|> colorParser a) eof -- | Parses a maximal string without color markup. textParser :: String -> Maybe Action -> Parser [(Widget, ColorString, Maybe Action)] @@ -74,14 +75,16 @@ actionParser :: String -> Parser [(Widget, ColorString, Maybe Action)] actionParser c = do a <- between (string "") (many1 (noneOf ">")) let a' = Just (Spawn a) - s <- manyTill (try (textParser c a') <|> try (iconParser c a') <|> try (colorParser a') <|> actionParser c) (try $ string "") + s <- manyTill (try (textParser c a') <|> try (iconParser c a') <|> + try (colorParser a') <|> actionParser c) (try $ string "") return (concat s) -- | Parsers a string wrapped in a color specification. colorParser :: Maybe Action -> Parser [(Widget, ColorString, Maybe Action)] colorParser a = do c <- between (string "") colors - s <- manyTill (try (textParser c a) <|> try (iconParser c a) <|> try (colorParser a) <|> actionParser c) (try $ string "") + s <- manyTill (try (textParser c a) <|> try (iconParser c a) <|> + try (colorParser a) <|> actionParser c) (try $ string "") return (concat s) -- | Parses a color specification (hex or named) -- cgit v1.2.3