Commit Graph

23 Commits

Author SHA1 Message Date
Kat Marchán 5809d21898
require terminator after node_children too 2020-12-18 22:53:59 -08:00
Kat Marchán 2c443aed85
cargo fmt 2020-12-18 22:35:52 -08:00
Kat Marchán ede98b9a7b
fix nodes
Credit: @lucretiel
2020-12-18 22:32:06 -08:00
Kat Marchán d0d241b65f
broken nodes parser that should really work? 2020-12-18 21:19:27 -08:00
Kat Marchán 2f282ee206
unnecessary slice 2020-12-18 21:05:01 -08:00
Kat Marchán b4d3f07d09
more stuff 2020-12-18 20:46:52 -08:00
Kat Marchán a032a9ec86
fix a bunch of stuff and write tests for slashdash 2020-12-18 20:09:59 -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
Lily Ballard d7670e17b4
Add line, column to KdlError (#3)
* Add line and column numbers to KdlError

These numbers are calculated using our `newline` rule, as I'm not aware
of any standard for how to calculate line numbers in error messages.

The error retains the original `offset` field as well, but it's now
expressed in characters rather than bytes.

* Clean up error handling in parse_document()

We don't need to worry about `Incomplete` errors, the `complete` family
of parsers (which we're using) doesn't ever produce those. We can use
the `.finish()` function to unwrap the error instead, so we don't have
to worry about the underlying error types.
2020-12-16 17:43:13 -08:00
Lily Ballard c61ef72b03
Export KdlNodeValue (#4) 2020-12-16 17:42:54 -08:00
Lily Ballard 597b89a6cd
Fix newline handling in single-line comments (#2) 2020-12-16 00:49:13 -08:00
Lily Ballard b5f8561b79
Replace ```ignore with ```text (#21)
Using the `ignore` marker makes `cargo test` think this is rust code
that should be ignored, which means it prints an "ignored" line in the
test output. It also makes `cargo doc --document-private-items` attempt
to colorize it as rust code. Marking this as `text` instead fixes both
issues.
2020-12-14 17:40:11 -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 e715b08800
strings done! 2020-12-13 22:25:55 -08:00
Kat Marchán 7ec15b7a04
reserve # so stuff like serde can use it for, say, indexing into values 2020-12-13 20:45:28 -08:00
Kat Marchán 4b4ffb71fd
0 is an integer (thanks, tef!) 2020-12-13 17:28:24 -08:00
Kat Marchán 842d1da3b9
numbers 2020-12-13 16:47:36 -08:00
Kat Marchán 54299642da
fix raw_string 2020-12-12 18:44:05 -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
Kat Marchán a8475fd2c7
initial commit 2020-12-10 18:42:50 -08:00