From 014723497f53f6aa070ffee438f43abaed9f0f06 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 16 Oct 2008 04:17:25 +0000 Subject: [PATCH] allow any non-whitespace in account names, perhaps avoiding misleading missing amounts errors --- Ledger/Parse.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Ledger/Parse.hs b/Ledger/Parse.hs index f03bc8b56..cadd52bad 100644 --- a/Ledger/Parse.hs +++ b/Ledger/Parse.hs @@ -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: