fix some breakages found by Hydra
This commit is contained in:
parent
21f359f56a
commit
d158d401d9
@ -56,7 +56,7 @@ import System.FilePath
|
|||||||
import Hledger.Data
|
import Hledger.Data
|
||||||
-- XXX too much reuse ?
|
-- XXX too much reuse ?
|
||||||
import Hledger.Read.JournalReader (
|
import Hledger.Read.JournalReader (
|
||||||
directive, historicalpricedirective, defaultyeardirective, emptyline, datetime,
|
directive, historicalpricedirective, defaultyeardirective, emptyline, datetimep,
|
||||||
parseJournalWith, getParentAccount
|
parseJournalWith, getParentAccount
|
||||||
)
|
)
|
||||||
import Hledger.Utils
|
import Hledger.Utils
|
||||||
@ -100,7 +100,7 @@ timelogentry :: GenParser Char JournalContext TimeLogEntry
|
|||||||
timelogentry = do
|
timelogentry = do
|
||||||
code <- oneOf "bhioO"
|
code <- oneOf "bhioO"
|
||||||
many1 spacenonewline
|
many1 spacenonewline
|
||||||
datetime <- datetime
|
datetime <- datetimep
|
||||||
comment <- optionMaybe (many1 spacenonewline >> liftM2 (++) getParentAccount restofline)
|
comment <- optionMaybe (many1 spacenonewline >> liftM2 (++) getParentAccount restofline)
|
||||||
return $ TimeLogEntry (read [code]) datetime (maybe "" rstrip comment)
|
return $ TimeLogEntry (read [code]) datetime (maybe "" rstrip comment)
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@ getTransaction j opts defdate moredefs = do
|
|||||||
-- A default date, and zero or more defaults for subsequent fields, are provided.
|
-- A default date, and zero or more defaults for subsequent fields, are provided.
|
||||||
getTransactionOrRestart :: Journal -> CliOpts -> String -> [String] -> IO (Maybe Transaction)
|
getTransactionOrRestart :: Journal -> CliOpts -> String -> [String] -> IO (Maybe Transaction)
|
||||||
getTransactionOrRestart j opts defdate moredefs = do
|
getTransactionOrRestart j opts defdate moredefs = do
|
||||||
let dateandcodep = do {d <- smartdate; c <- optionMaybe code; many spacenonewline; eof; return (d, fromMaybe "" c)}
|
let dateandcodep = do {d <- smartdate; c <- optionMaybe codep; many spacenonewline; eof; return (d, fromMaybe "" c)}
|
||||||
datecodestr <- runInteractionDefault $ askFor "date"
|
datecodestr <- runInteractionDefault $ askFor "date"
|
||||||
(Just defdate)
|
(Just defdate)
|
||||||
(Just $ \s -> null s
|
(Just $ \s -> null s
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user