| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
| |
| |
| | |
We don't need the helper struct for this.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We're going to want this macrology to generate a encoder
implmeentation too. It's most convenient to make this its own module,
separating it from parse2_impls.
Enable the module if encoding is enabled, decorating its
parsing-related contents with the appropriate cfg.
Use pub(super) to export the encoding-related imports, so that we
don't end up with endlessly duplicated import lists.
Now there is place where we can put the encoder.
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
Start a new encode_impls module.
The pub(super) will be used in a moment.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
This is what we did for authcert.rs and it worked well there.
|
| | | |
|
| | | |
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | | |
Add debugging support to ItemValueParseable derive
See merge request tpo/core/arti!3881
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With
cargo test --all-features -p tor-netdoc -- --no-capture test2
the output now contains, amongst many other things:
netdoc TestItem parse: item start, "test-item", "N", Some("TEST OBJECT")
netdoc TestItem parse: field needed, normal, args=1, "N"
netdoc TestItem parse: field optional, normal, args=Option<_>, ""
netdoc TestItem parse: field rest, normal, args=Vec<_>, ""
netdoc TestItem parse: field object, object, object=1, Some(("TEST OBJECT", Ok(5)))
netdoc TestItem parse: item complete Ok
|
| | | | |
|
| | | |
| | |
| | |
| | | |
So far this just abolishes a duplicate P.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
We're going to want tio reuse dtrace from here in the
ItemValueParseable derive (which doesn't use
NetdocSomeItemsParseableCommon because it derives for one item type,
not a document containing multiple items).
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Without this adding `#[deftly(netdoc(debug))]` can fail to build,
because the encoding module doesn't have `io::Write` in its `pub use`.
(Unlike parse2, it doesn't have a separate macro prelude.)
|
| | | |
| | |
| | |
| | | |
Ie for "arguments" that don't actually appear.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This will let us use it in more places, more sensibly.
Sadly it means a lot of syntactic vinegar at many of the call sites in
the old parser, which has very janky ideas about how errors should
work.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
Tests will come in a moment.
|
| | | |
| | |
| | |
| | | |
Tests will come in a moment.
|
| |\ \ \
| |_|/
|/| |
| | |
| | | |
tor-netdoc: derives: Three small improvements
See merge request tpo/core/arti!3887
|
| | | |
| | |
| | |
| | |
| | |
| | | |
This can't trigger, but when messing about with some new features,
I messed up and got a syntax error here. Let's try this feature out,
here.
|
| | | |
| | |
| | |
| | | |
No functional change.
|
| | |/
| |
| |
| | |
T_SIGNATURES is false, just above.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-netdoc: parse2: Fix error for invalid item argument
See merge request tpo/core/arti!3879
|
| | |/
| |
| |
| | |
When we can't parse a NormalItemArgument, that's Invalid, not Missing.
|
| | |
| |
| |
| |
| | |
I also searched this file for FromStr impls and these types were the
only ones that ought to be NormalItemArgument but weren't.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
Unfortunately one derive can't invoke another, so we must open-code
them, just like the other traits.
|
| | |
| |
| |
| |
| |
| |
| | |
Nothing derives just Transparent yet.
Mostly code motion, with some additional furniture and docs.
Review with git show --color-moved.
|
| | |
| |
| |
| |
| |
| | |
This error message is going to be used by both Transparent and
BytesTransparent. Put it in the code that is going to be part of
Transparent, and remove the macro name from it.
|
| | | |
|
| | |
| |
| |
| | |
This reduces clutter some more.
|
| | |
| |
| |
| |
| |
| | |
This is in the use's at the top of the file. If we `use super::*`
(like we do in the newer modules): the code can get a lot more
readable.
|
| | |
| |
| |
| |
| |
| |
| | |
Test the parsing and printing success cases.
Given that the parsing implementation is just a wrapper around B16's,
we don't need explicit tests for that.
|
| | |
| |
| |
| |
| | |
Make this a public BytesTransparent newtype like B64, implementing all
the same traits etc.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
On reflection, and looking at the test cases, I think the name `B16`
should refer to the lowercase version. I'll introduce a type for
uppercase in a moment.
Test the display implementation.
|
| | |
| |
| |
| |
| |
| |
| | |
Replace the open-coded .parse() calls with a closure.
This will let us test round trips, other types, etc., for each pairs
of test values.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Firstly, make its field pub.
Secondly, make the into_array method crate-private. It has a
crate-specific (albeit public) error type, The same basic effect can
be achieved with methods from std on arrays and slices.
|