kdl-rs
kdl-rs copied to clipboard
Rust parser for KDL
A lot easier than #55, actually Includes/closes #53; redoes #49 properly. cc @cbiffle one last time
Closes #53 (built on top of it), closes #54 This PR takes the approach that calling `fmt` should always fully fill in the `leading`/`trailing` fields to be explicit. A separate...
```rust fn build_abc() -> KdlDocument { let mut c = KdlNode::new("c"); c.ensure_children(); let mut b = KdlNode::new("b"); b.ensure_children().nodes_mut().push(c); let mut a = KdlNode::new("a"); a.ensure_children().nodes_mut().push(b); let mut doc = KdlDocument::new(); doc.nodes_mut().push(a);...
In order, - Updates the test to pass on main (4ac459a) - Reverts #49 and the format mangling resulting from it (f820145) - Adds a new test showing the case...
```rust fn main() { let test = r#" // Nodes can be separated into multiple lines title \ "Some title" // Files must be utf8 encoded! smile "😁" // Instead...
This should make the CI happier
Steps to reproduce: ```rust use kdl::{KdlIdentifier, KdlNode}; use std::fmt::Display; // crates/core/src/config.rs:266:22 | 266 | section_node.fmt(); | ^^^- supplied 0 arguments | | | expected 1 argument | note: associated function...
Currently, we pretty much just throw floats at `format!("{:?}")` and call it a day. Unfortunately, this yields different results depending on Rust version (for example, 1.56 vs 1.60, so not...
There should be a nice query API (possibly/probably using KQL?) to fetch individual nodes or sets of nodes.