mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
lib: remove redundant check in accountnamep
This commit is contained in:
parent
43aa3d479e
commit
d79e707485
@ -461,14 +461,7 @@ accountnamep :: TextParser m AccountName
|
||||
accountnamep = do
|
||||
firstPart <- part
|
||||
otherParts <- many $ try $ singleSpace *> part
|
||||
let account = T.unwords $ firstPart : otherParts
|
||||
|
||||
let roundTripAccount =
|
||||
accountNameFromComponents $ accountNameComponents account
|
||||
when (account /= roundTripAccount) $ fail $
|
||||
"account name seems ill-formed: " ++ T.unpack account
|
||||
|
||||
pure account
|
||||
pure $ T.unwords $ firstPart : otherParts
|
||||
where
|
||||
part = takeWhile1P Nothing (not . isSpace)
|
||||
singleSpace = void spacenonewline *> notFollowedBy spacenonewline
|
||||
|
Loading…
Reference in New Issue
Block a user