From 9f3d337e753826da3f48cc45b664f4a919a67058 Mon Sep 17 00:00:00 2001 From: Martin Perner Date: Sat, 27 Aug 2011 13:29:50 +0200 Subject: Fix the detection of the end of the command array It was only looked for a ']' followed by space-characters and either a '}' or ','. This looks good in generally but considering that a command can have as its last input parameter an array e.g. ... , Run Something ["Do"] , Run XMonadLog ] , sepChar = "%" } ... This will not work unless 'Something' is the last command in the array. This patch fixes this problem, as a ',' is only accepted if it is not followed by a "Run". --- src/Parsers.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Parsers.hs b/src/Parsers.hs index baaa287..f5f00a9 100644 --- a/src/Parsers.hs +++ b/src/Parsers.hs @@ -159,7 +159,8 @@ parseConfig = runParser parseConf fields "Config" . stripComments return ("Static {" ++ p ++ "}") tillFieldEnd = staticPos <|> many (noneOf ",}\n\r") - commandsEnd = wrapSkip (string "]") >> oneOf "}," + commandsEnd = wrapSkip (string "]") >> (string "}" <|> notNextRun) + notNextRun = do { string ","; notFollowedBy $ wrapSkip $ string "Run"; return ","} readCommands = manyTill anyChar (try commandsEnd) >>= read' commandsErr . flip (++) "]" strField e n = field e n . between (strDel "start" n) (strDel "end" n) . many $ noneOf "\"\n\r" -- cgit v1.2.3