penny-0.32.0.2: Extensible double-entry accounting system

Safe HaskellNone

Penny.Copper.Parsec

Description

Parsec parsers for the ledger file format.

Synopsis

Documentation

digitsRadDigitsSource

Arguments

:: Parser a

Parses a single grouping character

-> Parser void

Parses a radix point

-> Parser (GroupedDigits a, Maybe (GroupedDigits a)) 

Parses a sequence of grouped digits, followed by an optional radix point, followed by an optional additional sequence of grouped digits. Numbers such as .25 are not allowed; instead, the user must enter 0.25. Also not allowed is something like 25.. Intsead, if the user enters a radix, there must be a character after it.

unquotedQtyRep :: Parser QtyRepSource

Parses an unquoted QtyRep.

unquotedQtyRepWithSpaces :: Parser QtyRepSource

Parses an unquoted QtyRep that also has spaces. Use only when parsing command line items.

quotedCommaQtyRep :: Parser QtyRepSource

Parses a QtyRep that is quoted with square braces. This is a QtyRep that uses a comma as the radix point.

quotedPeriodQtyRep :: Parser QtyRepSource

Parses a QtyRep that is quoted with curly braces. This is a QtyRep that uses a period as the radix point. Unlike an unquoted QtyRep this can include spaces.

parseSource

Arguments

:: Text

Contents of file to be parsed

-> Either String [ParsedItem]

Returns items if successfully parsed; otherwise, returns an error message.

handleParseErrorSource

Arguments

:: String

Filename

-> String 
-> IO a