allow any non-whitespace in account names, perhaps avoiding misleading missing amounts errors

This commit is contained in:
Simon Michael 2008-10-16 04:17:25 +00:00
parent fdf4955007
commit 014723497f

View File

@ -268,7 +268,7 @@ ledgeraccountname = do
accountname <- many1 (accountnamechar <|> singlespace)
return $ striptrailingspace accountname
where
accountnamechar = alphaNum <|> oneOf ":/_" <?> "account name character"
accountnamechar = nonspace <?> "account name character"
singlespace = try (do {spacenonewline; do {notFollowedBy spacenonewline; return ' '}})
-- couldn't avoid consuming a final space sometimes, harmless
striptrailingspace s = if last s == ' ' then init s else s
@ -359,6 +359,8 @@ restofline = anyChar `manyTill` newline
whiteSpace1 :: Parser ()
whiteSpace1 = do space; whiteSpace
nonspace = satisfy (not . isSpace)
{-| Parse a timelog file. Here is the timelog grammar, from timeclock.el 2.6: