Commit Graph

20 Commits

Author SHA1 Message Date
Nicola Papale cd2d6e42b1
feat(fmt): Add clear_fmt_recursive method (#45)
Fixes #46

When comparing two different `KdlNode` or `KdlDocument`, it's useful to
have a "canonical" representation where formatting differences do not
matter.

`clear_fmt` removes all formatting from a `KdlNode`, but does not apply
recursively, as a result, it doesn't create a canonical representation.
`clear_fmt_recursive` solves this by applying `clear_fmt` recursively to
the contents of the node.
2022-06-10 17:05:58 -07:00
Kat Marchán 58a40fdf48
fix(compliance): pull in spec test suite and fix issues (#40)
This commit includes a whole bunch of fixes, some of which are significant changes to the parser and some related functionality. But I consider all changes to be bugfixes because they were compliance failures.
2022-04-27 23:21:28 -07:00
Kat Marchán 12d373a1e0
feat(fmt): shiny new comment-preserving formatter! (#38)
Fixes: https://github.com/kdl-org/kdl-rs/issues/34
2022-04-23 22:34:51 -07:00
Kat Marchán 177c42cae7
feat(len): add APIs to calculate component lengths (#36)
Fixes: https://github.com/kdl-org/kdl-rs/issues/19
2022-04-23 02:15:31 -07:00
Kat Marchán 1a8eb35168 fix(parse): small parser tweaks + more tests 2022-04-23 01:21:28 -07:00
Kat Marchán 892bf06e69 feat(clear_fmt): add methods to clear formatting and reset it to default 2022-04-23 01:21:28 -07:00
Kat Marchán fc1d0fd24b chore: clean up and docs 2022-04-23 01:21:28 -07:00
Kat Marchán a1555949ed refactor: clean up parser/FromStr toplevel stuff and add one for KdlIdentifier 2022-04-23 01:21:28 -07:00
Kat Marchán 16c82f1ec1
feat(types): add type annotation support (#31) 2022-04-22 12:00:32 -07:00
Kat Marchán 364ea6173c
feat(api): complete rewrite into document-oriented parser (#29)
This new version of kdl-rs is a complete rewrite that introduces
a formatting-aware-and-preserving parser, much like toml_edit et al.

BREAKING CHANGE: Completely new API and bumped MSRV to 1.56.0.
2022-04-22 02:20:30 -07:00
jam1garner 94190697d8
feat(docs): Add documentation for the entire crate (#16) 2021-05-08 14:40:15 -07:00
hclarke b8c8b52748
feat(display): implemented Display for KdlNode (#6) 2021-05-08 14:39:35 -07:00
Kat Marchán 2c443aed85
cargo fmt 2020-12-18 22:35:52 -08:00
Kat Marchán b4d3f07d09
more stuff 2020-12-18 20:46:52 -08:00
Lily Ballard 685a537658
Add From and TryFrom impls for converting to/from KdlNodeValue (#5)
* Add From impls for KdlNodeValue

Most clients probably don't need to create these directly, but we may as
well make it easy for them.

* Add TryFrom impls to convert from KdlNodeValue to underlying types

This includes converting from borrowed values, which will produce `&str`
instead of `String`.
2020-12-16 17:47:39 -08:00
Kat Marchán 75c176ae54
switch to LF line endings 2020-12-14 00:07:14 -08:00
Kat Marchán 42564a7cf7
rename Node and NodeValue 2020-12-13 22:31:30 -08:00
Kat Marchán a316f6d2ef
some progress + tests 2020-12-12 17:51:18 -08:00
Kat Marchán 100a736145
node, identifier, and comments done 2020-12-12 15:07:19 -08:00
Kat Marchán 3296cc83a0
wip parser 2020-12-12 11:50:34 -08:00