diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-01-28 19:33:02 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-01-28 19:33:02 +0100 |
commit | 68c11b78914aaf7c5d5549637ceedfd2abe77c64 (patch) | |
tree | 9527c908e4dc877801b2c41c298cb86eab69bbc4 /Parsers.hs | |
parent | fe4c609e699237f7b272c56506106153f363dcb2 (diff) | |
download | xmobar-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.hs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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) |