All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
2.2.1 - 2024-04-28
- Fix
Debug
implementation ofError
which was dumping the whole input
2.2.0 - 2024-03-29
- implement
FromStr
forAccount
,Date
,Currency
andmetadata::Key
- implement
Default
forCost<D>
Date::new
constructor
- Support non-standard account name (#75). Thanks to @Bergschrat1
2.1.0 - 2024-01-29
Balance::tolerance
field
- Accept tolerance syntax
2.0.4 - 2024-01-19
- Accept negation of grouped expression (example:
-(2 * 3)
) - Do not require space between strings and tags/links
2.0.3 - 2024-01-18
- Accept comma (
,
) as a thousand separator in amounts - Accept dot (
.
) in transaction links - Accept escaped backslash (
\\
) in string
2.0.2 - 2024-01-17
- Accept escaped double quotes (
\"
) in strings
2.0.1 - 2024-01-07
Accept commodities ending with a number (#63). Thanks @doriath for the fix.
2.0.0 - 2023-07-11
This is a full rewrite of the parser from scratch. Most types have been either removed or changed in an incompatible way.
Here are some key differences with the previous API:
- The types no longer have a lifetime parameter, so that they can be manipulated more easily, even after the input string is discarded.
- Struct fields are public, which makes much easier to destruct and pattern-match the results of the parser.
- The directive type is now a struct (not an enum) that contains common directive data (date and metadata).
And there is a new
DirectiveContent
enum which is roughly equivalent to the previousDirective
enum. - The parser is more strict about what beancount syntax is considered valid.
Check the documentation to see how the new API looks like.
Note
You may depend on both the version 1 and 2 at the same time like this:
[dependencies] # version 1, in rust code `use beancount_parser::...` beancount-parser = { version = "1" } # version 2, in rust code `use beancount_parser_2::...` beancount-parser-2 = { package = "beancount-parser", version = "2.0.0" }
- Cargo feature flag
miette
, which enable implementation ofmiette::Diagnostic
for error types
2.0.0-beta.3 - 2023-07-09
- The
Amount
type is now exhaustive - Support booking method in open account directive
- implement
std::error::Error
forConversionError
- implement
FromStr
forDirective<D>
whereD: Decimal
2.0.0-beta.2 - 2023-07-08
Entry
enum which is one ofDirective
,Option
,Include
parse_iter
which return an iterator overResult<Entry<D>, Result>
- implement
Clone
forError
- implement
FromStr
forBeancountFile<D>
whereD: Decimal
read_files
to read and parse files from disk, following the include directives
2.0.0-beta.1 - 2023-07-01
I finally decided to re-use the old crate name beancount-parser
instead of continuing with beancount_parser_2.
This release contains exactly the same functionality beancount_parser_2
version 1.0.0-beta.3
.
beancount_parser_2
will be discontinued and archived soon.
This is a full rewrite of the parser from scratch. Most types have been either removed or changed in an incompatible way. This new version is also more strict about what beancount syntax is considered valid.
Check the documentation to see how the new API looks like.
Note
You may depend on both the version 1 and 2 at the same time like this:
[dependencies] # version 1, in rust code `use beancount_parser::...` beancount-parser = { version = "1" } # version 2, in rust code `use beancount_parser_2::...` beancount-parser-2 = { package = "beancount-parser", version = "=2.0.0-beta.1" }
- Transaction
- flag
- payee and description
- tags
- links
- metadata
- postings
- account
- amount
- price
- cost
- amount
- date
- metadata
- Price directive
- Open and close directives
- Balance assertion
- Commodity declaration
- Events
- Options
- Directive metadata (string values only)
@doriath
1.16.2 - 2023-06-20
The pest
experiment was not conclusive. It is much slower than the nom
implementation and the code is not significantly more maintainable in my opinion.
On top of that, the latest pest
patch contained some breaking changes, causing new compile errors.
Therefore, this release completely removes the pest parser.
1.16.1 - 2023-05-22
Announce new status of the project in readme: The project is now in "maintenance mode"
1.16.0 - 2023-05-14
-
remove
Error::line_number
(Instead, I am working on a wrapper type which would work for locating both errors and successfuly parsed directives)
- implement
Default
fortransaction::Flag
(The default value istransaction::Flag::Cleared
)
- Accept account types without more components. (e.g.
2023-05-13 open Assets
is now valid) - Ignore trailing spaces after transaction/posting declarations
- Accept amount values with the unary operator
+
(e.g.+42
) - Accept spaces before comma in currency list of open directive
Warning
The unstable API requires the
unstable
feature flag. It is not considered part of the public API and is subject to breaking changes.
- Parse
option
directive - Parse
event
directive - Parse
commodity
directive
1.15.0 - 2023-03-07
-
AccountType
alias foraccount::Type
-
unstable:
metadata
modulewhich makes possible to pattern match the result of
Transaction::metadata
.
-
Type
It has been made public by mistake. Use
AccountType
oraccount::Type
instead.
- readme: Warning about unsupported feature flags
1.14.0 - 2023-02-24
-
provide(7602beb)AccountType
from root module (equivalent ofaccount::Type
)By mistake this change re-exported
account::Type
asType
instead ofAccountType
.
1.13.0 - 2023-02-17
- pad directive (e3034e7)
- fix a broken link (b943bd7)
1.12.0 - 2023-02-05
- implement
Display
foraccount::Type
(eb6bf10) - implement
Display
forAccount
(b890620) - stabilize include directive (60c7a2b)
1.11.1 - 2023-02-03
- unstable: Add support for
include
directives (#24) (e39c414) - unstable: Make the include direcvie return a
&Path
(480061a)
1.11.0 - 2023-01-27
- postings not parsed when transaction has metadata (d6be280)
1.10.1 - 2023-01-23
- failure to parse currencies with numbers or special chars (#21) (d5f548e)
- failure to parse terminal decimal points (#19) (0e31ae4)
- incorrect lot attributes parsing (#20) (04c2d9a)
1.10.0 (2023-01-11)
- extend the lifetime of items returned by
Account::components()
(c56d5b1)
- unstable: Remove transaction balancing and amount sum logic (a6fb067)
1.9.1 - 2023-01-09
- readme: add rustc badge (f0becaf)
- readme: fix build badge url (1cbdcc1)
- readme: remove build badge (7df7d5a)
- readme: update rustc badge (4a9a6c3)
1.9.0 - 2022-12-13
1.8.4 - 2022-11-20
- unstable: fix error line-number after a multiline transaction (93625ba)
1.8.3 - 2022-11-19
- unstable: line number on error type (b2edd5c)
1.8.2 - 2022-11-13
- Show API behind feature flags on docs.rs
1.8.1 - 2022-11-10
- Fix typos
1.8.0 - 2022-11-08
Date::new
constructor
1.7.0 - 2022-11-06
date
getter onDirective
1.6.0 - 2022-11-06
- Implement
Ord
forDate
(fix #8)
1.5.0 - 2022-11-06
- Close directive (fix #7)
1.4.0 - 2022-11-05
- Currency constraints on open directive
- Currency constraint on open directive
- Unstable feature flag
1.3.1 - 2022-10-20
- Poptag being ignored
- Pushtag being ignored
1.3.0 - 2022-10-15
- Make the
Price
type public
1.2.0 - 2022-10-14
- Open account directive
- Failure when parsing cost with date
1.1.0 - 2022-10-13
- Fix small typos
-
Parse transaction tags
-
Parse comment on price directive
-
Parse price directive
1.0.0 - 2022-10-11
- Improve wording
- Conversion from
Value
intorust_decimal::Decimal
Directive::into_transaction
- Expose the transaction module
- Expose the
amount
module
- Minor simplification of the root crate example
- Make
Transaction::postings
return a slice instead of aVec
- Document the
Directive
type - Document the
Account
type - Document the
Transacion
andPosting
types - Document the
Date
type
- Include date on
Transaction
type
- Iterate directives instead of tuples (date, directive)
- Minor rewordings of the readme
- Document the main error type
- Document the amount type
- documentation of
Parser
type
- Conversion of
Value
intof32
- Conversion of
Value
intof64
- Basic documentation
- Expression evaluation
- directive::as_transaction
- Ignore unknown directives
- Ignore comment lines
- Parse directives
Parser
iterator type