summaryrefslogtreecommitdiffhomepage
path: root/Parsers.hs
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-01-28 19:33:02 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-01-28 19:33:02 +0100
commit68c11b78914aaf7c5d5549637ceedfd2abe77c64 (patch)
tree9527c908e4dc877801b2c41c298cb86eab69bbc4 /Parsers.hs
parentfe4c609e699237f7b272c56506106153f363dcb2 (diff)
downloadxmobar-68c11b78914aaf7c5d5549637ceedfd2abe77c64.tar.gz
xmobar-68c11b78914aaf7c5d5549637ceedfd2abe77c64.tar.bz2
Allow comments and leading whitespace in config (Adam Vogt)
Ignore-this: 121d37987dbb55c41ee5799a5ec94e57 darcs-hash:20100128183302-1d908-45e2953a96d886af0a8c5070aca3c9024ad0deaa.gz
Diffstat (limited to 'Parsers.hs')
-rw-r--r--Parsers.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Parsers.hs b/Parsers.hs
index 88b25f1..57fae00 100644
--- a/Parsers.hs
+++ b/Parsers.hs
@@ -119,10 +119,10 @@ stripComments = unlines . map (drop 5 . strip False . (replicate 5 ' '++)) . lin
parseConfig :: String -> Either ParseError (Config,[String])
parseConfig = runParser parseConf fields "Config" . stripComments
where
- parseConf = do
- many space
- sepEndSpc ["Config","{"]
- x <- perms
+ parseConf = parse $ do
+ sepEndSpaces ["Config","{"]
+ x <- unWrapParser perms
+ wrapSkip (string "}")
eof
s <- getState
return (x,s)