Given an account name and its account directive, and a problem tag within the latter: render it as a megaparsec-style excerpt, showing the original line number and marked column or region. Returns the file path, line number, column(s) if known, and the rendered excerpt, or as much of these as is possible. The returned columns will be accurate for the rendered error message but not for the original journal data.
Modulehledger-lib-1.52.4GHC2021
Hledger.Data.Errors
Helpers for making error messages.
- 7 values
- Packagehledger-lib-1.52.4
- Exports7
- LanguageGHC2021
- LicenceGPL-3.0-or-later
- SourceErrors.hs
Given a problem price directive, and maybe a function to calculate the error region's column(s) (currently ignored): generate a megaparsec-style error message with highlighted excerpt. Returns the source file path, line number, column(s) if known, and the rendered excerpt, or as much of these as possible. Columns will be accurate for the rendered error message, not for the original journal entry.
Given a problem transaction and a function calculating the best column(s) for marking the error region: render it as a megaparsec-style excerpt, showing the original line number on the transaction line, and a column(s) marker. Returns the file path, line number, column(s) if known, and the rendered excerpt, or as much of these as is possible. The returned columns will be accurate for the rendered error message but not for the original journal data.
Given a problem posting and a function calculating the best column(s) for marking the error region: look up error info from the parent transaction, and render the transaction as a megaparsec-style excerpt, showing the original line number on the problem posting's line, and a column indicator. Returns the file path, line number, column(s) if known, and the rendered excerpt, or as much of these as is possible. A limitation: columns will be accurate for the rendered error message but not for the original journal data.
From the given posting, make an error excerpt showing the transaction with this posting's account part highlighted.
From the given posting, make an error excerpt showing the transaction with the balance assertion highlighted.
Find the 1-based index of the first posting in this transaction satisfying the given predicate.