diff --git a/NOTES b/NOTES index a6d980ee5..87cbf8f0a 100644 --- a/NOTES +++ b/NOTES @@ -2,9 +2,6 @@ hledger project notes * TO DO ** bugs -*** unclear parse error when only one space before amount - unexpected "$" - expecting letter or digit, ":", "/", "_", amount, comment or new-line *** handle unknown currencies ** compatibility ** basic features diff --git a/Parse.hs b/Parse.hs index 163908f1d..8bdbf4a00 100644 --- a/Parse.hs +++ b/Parse.hs @@ -210,8 +210,8 @@ ledgertransactions = (ledgertransaction "transaction") `manyTill` (do {newli ledgertransaction :: Parser Transaction ledgertransaction = do many1 spacenonewline - account <- ledgeraccount "account" - amount <- ledgeramount "amount" + account <- ledgeraccount + amount <- ledgeramount many spacenonewline ledgereol many ledgercomment @@ -219,7 +219,9 @@ ledgertransaction = do -- account names may have single spaces in them, and are terminated by two or more spaces ledgeraccount :: Parser String -ledgeraccount = many1 (alphaNum <|> char ':' <|> char '/' <|> char '_' <|> try (do {spacenonewline; do {notFollowedBy spacenonewline; return ' '}})) +ledgeraccount = + many1 ((alphaNum <|> char ':' <|> char '/' <|> char '_' "account name") + <|> try (do {spacenonewline; do {notFollowedBy spacenonewline; return ' '}} "double space")) ledgeramount :: Parser Amount ledgeramount =