hledger-lib 1.16.1 → 1.16.2
raw patch · 15 files changed
+202/−96 lines, 15 filesdep ~megaparsecPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: megaparsec
API changes (from Hackage documentation)
Files
- CHANGES.md +3/−1
- Text/Megaparsec/Custom.hs +10/−1
- hledger-lib.cabal +5/−5
- hledger_csv.5 +30/−1
- hledger_csv.info +76/−44
- hledger_csv.txt +47/−28
- hledger_journal.5 +1/−1
- hledger_journal.info +7/−2
- hledger_journal.txt +1/−1
- hledger_timeclock.5 +2/−2
- hledger_timeclock.info +7/−2
- hledger_timeclock.txt +4/−4
- hledger_timedot.5 +1/−1
- hledger_timedot.info +7/−2
- hledger_timedot.txt +1/−1
CHANGES.md view
@@ -1,9 +1,11 @@ Internal/api/developer-ish changes in the hledger-lib (and hledger) packages. For user-visible changes, see the hledger package changelog. -# 1.16.1 2019-12-03+# 1.16.2 2020-01-14 +- add support for megaparsec 8 (#1175) +# 1.16.1 2019-12-03 - Drop unnecessary mtl-compat dependency
Text/Megaparsec/Custom.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE BangPatterns #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} -- new {-# LANGUAGE LambdaCase #-}@@ -176,7 +177,12 @@ Left errBundle -> customFailure $ ErrorReparsing $ bundleErrors errBundle where- offsetInitialState :: Int -> s -> State s+ offsetInitialState :: Int -> s ->+#if MIN_VERSION_megaparsec(8,0,0)+ State s e+#else+ State s+#endif offsetInitialState initialOffset s = State { stateInput = s , stateOffset = initialOffset@@ -187,6 +193,9 @@ , pstateTabWidth = defaultTabWidth , pstateLinePrefix = "" }+#if MIN_VERSION_megaparsec(8,0,0)+ , stateParseErrors = []+#endif } --- * Pretty-printing custom parse errors
hledger-lib.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: f67238ad457aa23ba68686a932bc3f37f30d6f3f9f4514468e35e960ab81fe1b+-- hash: eff7cc5cd5bf68cfdad1cc47374767d072f03ed6de99dfbd286885788a26dbab name: hledger-lib-version: 1.16.1+version: 1.16.2 synopsis: Core data types, parsers and functionality for the hledger accounting tools description: This is a reusable library containing hledger's core functionality. .@@ -126,7 +126,7 @@ , file-embed >=0.0.10 , filepath , hashtables >=1.2.3.1- , megaparsec >=7.0.0 && <8+ , megaparsec >=7.0.0 && <8.1 , mtl >=2.2.1 , old-time , parsec >=3@@ -177,7 +177,7 @@ , file-embed >=0.0.10 , filepath , hashtables >=1.2.3.1- , megaparsec >=7.0.0 && <8+ , megaparsec >=7.0.0 && <8.1 , mtl >=2.2.1 , old-time , parsec >=3@@ -231,7 +231,7 @@ , filepath , hashtables >=1.2.3.1 , hledger-lib- , megaparsec >=7.0.0 && <8+ , megaparsec >=7.0.0 && <8.1 , mtl >=2.2.1 , old-time , parsec >=3
hledger_csv.5 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger_csv" "5" "December 2019" "hledger 1.16.1" "hledger User Manuals"+.TH "hledger_csv" "5" "January 2020" "hledger 1.16.2" "hledger User Manuals" @@ -508,6 +508,7 @@ .PP \f[C]balanceN\f[R] sets a balance assertion amount (or if the posting amount is left empty, a balance assignment).+You may need to adjust this with the \f[C]balance-type\f[R] rule. .PP Finally, \f[C]commentN\f[R] sets a comment on the Nth posting. Comments can also contain tags, as usual.@@ -731,6 +732,34 @@ ## common rules include categorisation.rules+\f[R]+.fi+.SS \f[C]balance-type\f[R]+.PP+Balance assertions generated by assigning to balanceN are of the simple+\f[C]=\f[R] type by default, which is a single-commodity,+subaccount-excluding assertion.+You may find the subaccount-including variants more useful, eg if you+have created some virtual subaccounts of checking to help with+budgeting.+You can select a different type of assertion with the+\f[C]balance-type\f[R] rule:+.IP+.nf+\f[C]+# balance assertions will consider all commodities and all subaccounts+balance-type ==*+\f[R]+.fi+.PP+Here are the balance assertion types for quick reference:+.IP+.nf+\f[C]+= single commodity, exclude subaccounts+=* single commodity, include subaccounts+== multi commodity, exclude subaccounts+==* multi commodity, include subaccounts \f[R] .fi .SH TIPS
hledger_csv.info view
@@ -1,9 +1,9 @@-This is hledger_csv.info, produced by makeinfo version 6.5 from stdin.+This is hledger_csv.info, produced by makeinfo version 6.7 from stdin. File: hledger_csv.info, Node: Top, Next: EXAMPLES, Up: (dir) -hledger_csv(5) hledger 1.16.1+hledger_csv(5) hledger 1.16.2 ***************************** hledger can read CSV (comma-separated value, or character-separated@@ -376,6 +376,7 @@ * date-format:: * newest-first:: * include::+* balance-type:: File: hledger_csv.info, Node: skip, Next: fields, Up: CSV RULES@@ -466,7 +467,8 @@ affects ALL postings. 'balanceN' sets a balance assertion amount (or if the posting amount-is left empty, a balance assignment).+is left empty, a balance assignment). You may need to adjust this with+the 'balance-type' rule. Finally, 'commentN' sets a comment on the Nth posting. Comments can also contain tags, as usual.@@ -625,7 +627,7 @@ newest-first -File: hledger_csv.info, Node: include, Prev: newest-first, Up: CSV RULES+File: hledger_csv.info, Node: include, Next: balance-type, Prev: newest-first, Up: CSV RULES 2.8 'include' =============@@ -648,6 +650,29 @@ include categorisation.rules +File: hledger_csv.info, Node: balance-type, Prev: include, Up: CSV RULES++2.9 'balance-type'+==================++Balance assertions generated by assigning to balanceN are of the simple+'=' type by default, which is a single-commodity, subaccount-excluding+assertion. You may find the subaccount-including variants more useful,+eg if you have created some virtual subaccounts of checking to help with+budgeting. You can select a different type of assertion with the+'balance-type' rule:++# balance assertions will consider all commodities and all subaccounts+balance-type ==*++ Here are the balance assertion types for quick reference:++= single commodity, exclude subaccounts+=* single commodity, include subaccounts+== multi commodity, exclude subaccounts+==* multi commodity, include subaccounts++ File: hledger_csv.info, Node: TIPS, Prev: CSV RULES, Up: Top 3 TIPS@@ -900,45 +925,52 @@ Ref: #paypal6532 Node: CSV RULES14415 Ref: #csv-rules14524-Node: skip14769-Ref: #skip14862-Node: fields15237-Ref: #fields15359-Node: Transaction field names16426-Ref: #transaction-field-names16586-Node: Posting field names16697-Ref: #posting-field-names16849-Node: field assignment18081-Ref: #field-assignment18217-Node: if19035-Ref: #if19144-Node: end20860-Ref: #end20966-Node: date-format21190-Ref: #date-format21322-Node: newest-first22071-Ref: #newest-first22209-Node: include22892-Ref: #include23000-Node: TIPS23444-Ref: #tips23526-Node: Valid CSV23775-Ref: #valid-csv23894-Node: Other separator characters24086-Ref: #other-separator-characters24274-Node: Reading multiple CSV files24603-Ref: #reading-multiple-csv-files24800-Node: Valid transactions25041-Ref: #valid-transactions25219-Node: Deduplicating importing25847-Ref: #deduplicating-importing26026-Node: Setting amounts27059-Ref: #setting-amounts27228-Node: Setting currency/commodity28214-Ref: #setting-currencycommodity28406-Node: Referencing other fields29209-Ref: #referencing-other-fields29409-Node: How CSV rules are evaluated30306-Ref: #how-csv-rules-are-evaluated30477+Node: skip14786+Ref: #skip14879+Node: fields15254+Ref: #fields15376+Node: Transaction field names16443+Ref: #transaction-field-names16603+Node: Posting field names16714+Ref: #posting-field-names16866+Node: field assignment18157+Ref: #field-assignment18293+Node: if19111+Ref: #if19220+Node: end20936+Ref: #end21042+Node: date-format21266+Ref: #date-format21398+Node: newest-first22147+Ref: #newest-first22285+Node: include22968+Ref: #include23097+Node: balance-type23541+Ref: #balance-type23659+Node: TIPS24359+Ref: #tips24441+Node: Valid CSV24690+Ref: #valid-csv24809+Node: Other separator characters25001+Ref: #other-separator-characters25189+Node: Reading multiple CSV files25518+Ref: #reading-multiple-csv-files25715+Node: Valid transactions25956+Ref: #valid-transactions26134+Node: Deduplicating importing26762+Ref: #deduplicating-importing26941+Node: Setting amounts27974+Ref: #setting-amounts28143+Node: Setting currency/commodity29129+Ref: #setting-currencycommodity29321+Node: Referencing other fields30124+Ref: #referencing-other-fields30324+Node: How CSV rules are evaluated31221+Ref: #how-csv-rules-are-evaluated31392 End Tag Table+++Local Variables:+coding: utf-8+End:
hledger_csv.txt view
@@ -396,7 +396,8 @@ fects ALL postings. balanceN sets a balance assertion amount (or if the posting amount is- left empty, a balance assignment).+ left empty, a balance assignment). You may need to adjust this with+ the balance-type rule. Finally, commentN sets a comment on the Nth posting. Comments can also contain tags, as usual.@@ -406,11 +407,11 @@ field assignment HLEDGERFIELDNAME FIELDVALUE - Instead of or in addition to a fields list, you can use a "field as-- signment" rule to set the value of a single hledger field, by writing- its name (any of the standard hledger field names above) followed by a- text value. The value may contain interpolated CSV fields, referenced- by their 1-based position in the CSV record (%N), or by the name they+ Instead of or in addition to a fields list, you can use a "field as-+ signment" rule to set the value of a single hledger field, by writing+ its name (any of the standard hledger field names above) followed by a+ text value. The value may contain interpolated CSV fields, referenced+ by their 1-based position in the CSV record (%N), or by the name they were given in the fields list (%CSVFIELDNAME). Some examples: # set the amount to the 4th CSV field, with " USD" appended@@ -419,7 +420,7 @@ # combine three fields to make a comment, containing note: and date: tags comment note: %somefield - %anotherfield, date: %1 - Interpolation strips outer whitespace (so a CSV value like " 1 " be-+ Interpolation strips outer whitespace (so a CSV value like " 1 " be- comes 1 when interpolated) (#1051). See TIPS below for more about ref- erencing other fields. @@ -434,28 +435,28 @@ RULE RULE - Conditional blocks ("if blocks") are a block of rules that are applied- only to CSV records which match certain patterns. They are often used+ Conditional blocks ("if blocks") are a block of rules that are applied+ only to CSV records which match certain patterns. They are often used for customising account names based on transaction descriptions. A single pattern can be written on the same line as the "if"; or multi- ple patterns can be written on the following lines, non-indented. Mul-- tiple patterns are OR'd (any one of them can match). Patterns are+ tiple patterns are OR'd (any one of them can match). Patterns are case-insensitive regular expressions which try to match anywhere within- the whole CSV record (POSIX extended regular expressions with some ad-+ the whole CSV record (POSIX extended regular expressions with some ad- ditions, see https://hledger.org/hledger.html#regular-expressions). Note the CSV record they see is close to, but not identical to, the one in the CSV file; enclosing double quotes will be removed, and the sepa- rator character is always comma. - It's not yet easy to match within a specific field. If the data does+ It's not yet easy to match within a specific field. If the data does not contain commas, you can hack it with a regular expression like: # match "foo" in the fourth field if ^([^,]*,){3}foo - After the patterns there should be one or more rules to apply, all in-- dented by at least one space. Three kinds of rule are allowed in con-+ After the patterns there should be one or more rules to apply, all in-+ dented by at least one space. Three kinds of rule are allowed in con- ditional blocks: o field assignments (to set a hledger field)@@ -479,7 +480,7 @@ comment XXX deductible ? check it end- This rule can be used inside if blocks (only), to make hledger stop+ This rule can be used inside if blocks (only), to make hledger stop reading this CSV file and move on to the next input file, or to command execution. Eg: @@ -490,10 +491,10 @@ date-format date-format DATEFMT - This is a helper for the date (and date2) fields. If your CSV dates- are not formatted like YYYY-MM-DD, YYYY/MM/DD or YYYY.MM.DD, you'll- need to add a date-format rule describing them with a strptime date- parsing pattern, which must parse the CSV date value completely. Some+ This is a helper for the date (and date2) fields. If your CSV dates+ are not formatted like YYYY-MM-DD, YYYY/MM/DD or YYYY.MM.DD, you'll+ need to add a date-format rule describing them with a strptime date+ parsing pattern, which must parse the CSV date value completely. Some examples: # MM/DD/YY@@ -515,15 +516,15 @@ mat.html#v:formatTime newest-first- hledger always sorts the generated transactions by date. Transactions- on the same date should appear in the same order as their CSV records,- as hledger can usually auto-detect whether the CSV's normal order is+ hledger always sorts the generated transactions by date. Transactions+ on the same date should appear in the same order as their CSV records,+ as hledger can usually auto-detect whether the CSV's normal order is oldest first or newest first. But if all of the following are true: - o the CSV might sometimes contain just one day of data (all records+ o the CSV might sometimes contain just one day of data (all records having the same date) - o the CSV records are normally in reverse chronological order (newest+ o the CSV records are normally in reverse chronological order (newest at the top) o and you care about preserving the order of same-day transactions@@ -536,9 +537,9 @@ include include RULESFILE - This includes the contents of another CSV rules file at this point.- RULESFILE is an absolute file path or a path relative to the current- file's directory. This can be useful for sharing common rules between+ This includes the contents of another CSV rules file at this point.+ RULESFILE is an absolute file path or a path relative to the current+ file's directory. This can be useful for sharing common rules between several rules files, eg: # someaccount.csv.rules@@ -551,6 +552,24 @@ ## common rules include categorisation.rules + balance-type+ Balance assertions generated by assigning to balanceN are of the simple+ = type by default, which is a single-commodity, subaccount-excluding+ assertion. You may find the subaccount-including variants more useful,+ eg if you have created some virtual subaccounts of checking to help+ with budgeting. You can select a different type of assertion with the+ balance-type rule:++ # balance assertions will consider all commodities and all subaccounts+ balance-type ==*++ Here are the balance assertion types for quick reference:++ = single commodity, exclude subaccounts+ =* single commodity, include subaccounts+ == multi commodity, exclude subaccounts+ ==* multi commodity, include subaccounts+ TIPS Valid CSV hledger accepts CSV conforming to RFC 4180. When CSV values are en-@@ -760,4 +779,4 @@ -hledger 1.16.1 December 2019 hledger_csv(5)+hledger 1.16.2 January 2020 hledger_csv(5)
hledger_journal.5 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger_journal" "5" "December 2019" "hledger 1.16.1" "hledger User Manuals"+.TH "hledger_journal" "5" "January 2020" "hledger 1.16.2" "hledger User Manuals"
hledger_journal.info view
@@ -1,10 +1,10 @@-This is hledger_journal.info, produced by makeinfo version 6.5 from+This is hledger_journal.info, produced by makeinfo version 6.7 from stdin. File: hledger_journal.info, Node: Top, Next: FILE FORMAT, Up: (dir) -hledger_journal(5) hledger 1.16.1+hledger_journal(5) hledger 1.16.2 ********************************* hledger's usual data source is a plain text file containing journal@@ -1863,3 +1863,8 @@ Ref: #editor-support63334 End Tag Table+++Local Variables:+coding: utf-8+End:
hledger_journal.txt view
@@ -1414,4 +1414,4 @@ -hledger 1.16.1 December 2019 hledger_journal(5)+hledger 1.16.2 January 2020 hledger_journal(5)
hledger_timeclock.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timeclock" "5" "December 2019" "hledger 1.16.1" "hledger User Manuals"+.TH "hledger_timeclock" "5" "January 2020" "hledger 1.16.2" "hledger User Manuals" @@ -63,7 +63,7 @@ and perhaps the extras in ledgerutils.el .IP \[bu] 2 at the command line, use these bash aliases:-\f[C]shell alias ti=\[dq]echo i \[ga]date \[aq]+%Y-%m-%d %H:%M:%S\[aq]\[ga] \[rs]$* >>$TIMELOG\[dq] alias to=\[dq]echo o \[ga]date \[aq]+%Y-%m-%d %H:%M:%S\[aq]\[ga] >>$TIMELOG\[dq]\f[R]+\f[C]shell alias ti=\[dq]echo i \[ga]date \[aq]+%Y-%m-%d %H:%M:%S\[aq]\[ga] \[rs]$* >>$TIMELOG\[dq] alias to=\[dq]echo o \[ga]date \[aq]+%Y-%m-%d %H:%M:%S\[aq]\[ga] >>$TIMELOG\[dq]\f[R] .IP \[bu] 2 or use the old \f[C]ti\f[R] and \f[C]to\f[R] scripts in the ledger 2.x repository.
hledger_timeclock.info view
@@ -1,10 +1,10 @@-This is hledger_timeclock.info, produced by makeinfo version 6.5 from+This is hledger_timeclock.info, produced by makeinfo version 6.7 from stdin. File: hledger_timeclock.info, Node: Top, Up: (dir) -hledger_timeclock(5) hledger 1.16.1+hledger_timeclock(5) hledger 1.16.2 *********************************** hledger can read timeclock files. As with Ledger, these are (a subset@@ -59,3 +59,8 @@ Node: Top78 End Tag Table+++Local Variables:+coding: utf-8+End:
hledger_timeclock.txt view
@@ -45,9 +45,9 @@ o use emacs and the built-in timeclock.el, or the extended timeclock- x.el and perhaps the extras in ledgerutils.el - o at the command line, use these bash aliases: shell alias ti="echo i- `date '+%Y-%m-%d %H:%M:%S'` \$* >>$TIMELOG" alias to="echo o `date- '+%Y-%m-%d %H:%M:%S'` >>$TIMELOG"+ o at the command line, use these bash aliases: shell alias ti="echo+ i `date '+%Y-%m-%d %H:%M:%S'` \$* >>$TIMELOG" alias to="echo o+ `date '+%Y-%m-%d %H:%M:%S'` >>$TIMELOG" o or use the old ti and to scripts in the ledger 2.x repository. These rely on a "timeclock" executable which I think is just the ledger 2@@ -78,4 +78,4 @@ -hledger 1.16.1 December 2019 hledger_timeclock(5)+hledger 1.16.2 January 2020 hledger_timeclock(5)
hledger_timedot.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timedot" "5" "December 2019" "hledger 1.16.1" "hledger User Manuals"+.TH "hledger_timedot" "5" "January 2020" "hledger 1.16.2" "hledger User Manuals"
hledger_timedot.info view
@@ -1,10 +1,10 @@-This is hledger_timedot.info, produced by makeinfo version 6.5 from+This is hledger_timedot.info, produced by makeinfo version 6.7 from stdin. File: hledger_timedot.info, Node: Top, Next: FILE FORMAT, Up: (dir) -hledger_timedot(5) hledger 1.16.1+hledger_timedot(5) hledger 1.16.2 ********************************* Timedot is a plain text format for logging dated, categorised quantities@@ -115,3 +115,8 @@ Ref: #file-format913 End Tag Table+++Local Variables:+coding: utf-8+End:
hledger_timedot.txt view
@@ -124,4 +124,4 @@ -hledger 1.16.1 December 2019 hledger_timedot(5)+hledger 1.16.2 January 2020 hledger_timedot(5)