aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/parse2
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-netdoc: parse2: Record previous position in ArgumentStream (fmt)Ian Jackson2025-10-091-1/+5
|
* tor-netdoc: parse2: Record previous position in ArgumentStreamIan Jackson2025-10-091-1/+8
|
* tor-netdoc: parse2: Rename methods on ArgumentStreamIan Jackson2025-10-092-10/+15
|
* tor-netdoc: parse2: Add whole_line_len to ArgumentStreamIan Jackson2025-10-092-4/+17
|
* tor-netdoc: Introduce `NormalItemArgument` impl-enabler traitIan Jackson2025-10-085-2/+8
| | | | | This is currently used to enable `parse2::ItemArgumentParseable`. In a moment it will enable `build::ItemArgument` too.
* tor-netdoc: parse2 poc: impl Display for several typesIan Jackson2025-10-084-3/+9
|
* tor-netdoc: parse2 poc: break out some constantsIan Jackson2025-10-081-3/+8
| | | | | We'll want this for both types eventually, when we do printing at the very least.
* tor-netdoc: impl Display for Fingerprint and Base64FingerprintIan Jackson2025-10-081-1/+1
| | | | | | | | I'm going to want this as preparation for making these things properly suitable for item arguments. One test case in parse2::poc was relying on Display of the Deref to RsaIdentity.
* tor-netdoc: parse2: Make NetdocParseableFields work out of-moduleIan Jackson2025-10-061-0/+9
|
* tor-netdoc: parse2: Break out check_no_objectIan Jackson2025-10-062-1/+9
| | | | This will be useful for impls of ItemValueParseable.
* tor-netdoc: parse2: Fix ItemValueParseable field attribute `with`Ian Jackson2025-10-062-2/+2
| | | | | According to the docs this is supposed to name the module, not the function. (This will be necessary when we do netdoc generation.)
* netdoc parse2 tests: Avoid <String as TryFrom<Vec<u8>>> (3)Ian Jackson2025-09-291-1/+1
|
* netdoc parse2 tests: Avoid <String as TryFrom<Vec<u8>>> (2) (fmt)Ian Jackson2025-09-291-2/+1
|
* netdoc parse2 tests: Avoid <String as TryFrom<Vec<u8>>> (2)Ian Jackson2025-09-291-2/+1
| | | | Should fix the minimal versions test?
* netdoc parse2 tests: Avoid <String as TryFrom<Vec<u8>>>Ian Jackson2025-09-291-1/+1
| | | | Should fix the minimal versions test?
* netdoc parse2: Remove some unneeded allowsIan Jackson2025-09-291-2/+0
|
* netdoc parse2: Fix two clippy lintsIan Jackson2025-09-291-1/+0
|
* neteoc parse2: Provide Ignored valueIan Jackson2025-09-291-0/+22
| | | | | This will be used for some bits of netdocs where dummy values now appear.
* netdoc parse2: NetdocParseableFields: suppress errors for empty typesIan Jackson2025-09-291-2/+10
|
* netdoc parse2: support `with` for rest arguemnts, and testIan Jackson2025-09-292-2/+18
|
* netdoc parse2: support `with` for normal arguemnts, and testIan Jackson2025-09-292-7/+11
|
* netdoc parse2: ArgumentSetMethods: take a parser functionIan Jackson2025-09-292-13/+65
| | | | We need this to support `with`.
* netdoc parse2: Support with for Item parsing, comprehensive testsIan Jackson2025-09-291-0/+64
|
* netdoc parse2: tests: NeedsWith typeIan Jackson2025-09-291-3/+55
| | | | This type will be used to test `with` attributes.
* netdoc parse2: Support with for Item parsingIan Jackson2025-09-291-2/+23
| | | | Tests will come in a moment.
* netdoc parse2: New single_item attribute, testsIan Jackson2025-09-291-6/+55
|
* netdoc parse2: New single_item attributeIan Jackson2025-09-292-2/+30
| | | | | | Many of the existing netdoc structs have items that are just the single argument. We don't want to turn them all into singleton tuples. Provide a macro feature for this instead.
* netdoc parse2: Break out ITEM_VALUE_FROM_UNPARSEDIan Jackson2025-09-291-2/+6
| | | | This is going to get more complicated.
* netdoc parse2: NetdocParseableFields: Fix default, and testIan Jackson2025-09-292-2/+9
|
* netdoc parse2: NetdocParseableFields: introduce use of $fpatnameIan Jackson2025-09-291-5/+4
| | | | We're going to want to do more complex things here.
* netdoc parse2: Run selector-based trait check for intro item tooIan Jackson2025-09-291-2/+6
|
* netdoc parse2: Tests for new Object handlingIan Jackson2025-09-291-1/+85
|
* netdoc parse2: Fix Object handling (fmt)Ian Jackson2025-09-291-2/+4
|
* netdoc parse2: Fix Object handlingIan Jackson2025-09-296-42/+132
| | | | | | | | | | Use the standard multiplicity technique rather than the ad-hoc impl on Option. This allows us to support an ad-hoc parsing function for a field that's `Option`. Disentangle the `label` field attribute, which did both setting the label, and expecting a different parsing approach: replace it with `with`.
* netdoc parse2: Fix label for PublicKeyIan Jackson2025-09-291-1/+1
| | | | | This mistake escaped because this wasn't actually checked by the code, but it's going to be checked in a moment.
* netdoc parse2: Fix "rest" item arguments, and testIan Jackson2025-09-293-5/+28
| | | | | The previous code didn't compile at all, and this went unnoticed because it wasn't used by the poc.
* netdoc parse2: Actually use ArgumentSetSelector, and testIan Jackson2025-09-293-6/+12
| | | | Without this, parsing of Option and Vec argument fields doesn't work.
* netdoc parse2: tests: Initial tests of ItemValueParseable macroIan Jackson2025-09-291-1/+76
| | | | | This macro has some problems which I'm going to fix. Add a test case for the parts that are currently working.
* netdoc parse2: Fix typo in todo commentIan Jackson2025-09-291-1/+1
|
* netdoc parse2: Don't duplicate the error sourceIan Jackson2025-09-291-1/+1
| | | | `problem` is the `#[source]`.
* netdoc parse2: Fix invalid keyword error problem reportIan Jackson2025-09-291-1/+1
| | | | `#[from]` is not `#[source]`. We need to print the inner error.
* netdoc parse2: tests: Better error messages from error tests (fmt)Ian Jackson2025-09-291-2/+10
| | | | Worsify formatting as demanded by rustdoc.
* netdoc parse2: tests: Better error messages from error testsIan Jackson2025-09-291-2/+2
|
* netdoc parse2: tests: Use ==== for dividers in outputIan Jackson2025-09-291-1/+1
| | | | Otherwise it's easy to get confuseed by ---- dividers for Objects.
* netdoc parse2: poc: Make test functions throw anyhow::ResultIan Jackson2025-09-291-5/+4
| | | | For reasons, TestResult doesn't print error sources.
* netdoc parse2: Fix keyword parsing to hate nul, not digit zero (!)Ian Jackson2025-09-291-1/+1
|
* netdoc parse2: Use $P::Result throughoutIan Jackson2025-09-292-5/+6
| | | | | This is needed when using these macros in a namespace with a local redefinition of `Result`.
* netdoc parse2: Fix a compile_error! invocationIan Jackson2025-09-291-1/+1
| | | | I triggered this error and it didn't work right.
* Produce better error messages from bad field types (fmt)Ian Jackson2025-09-022-4/+16
| | | | Worsify formatting as demanded by rustfmt.
* Produce better error messages from bad field typesIan Jackson2025-09-022-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, this diff > --- a/crates/tor-netdoc/src/parse2/poc/netstatus.rs > +++ b/crates/tor-netdoc/src/parse2/poc/netstatus.rs > @@ -24,5 +24,4 @@ pub enum NdaNetworkStatusVersion { > /// `params` value > #[derive(Clone, Debug, Default, Deftly)] > -#[derive_deftly(ItemValueParseable)] > #[non_exhaustive] > pub struct NdiParams { gives the errors below. So the first reported error points to the errant field, albeit with the slightly mendacious phrasing "this call". Previously there was only the 2nd message. Disagnosing that requires hunting through the document struct looking for fields of the right type, which can be seriously awkward when there are type aliases involved as there often are in tor-netdoc. > error[E0277]: the trait bound `parse2::poc::netstatus::NdiParams: parse2::traits::ItemValueParseable` is not satisfied > --> crates/tor-netdoc/src/parse2/poc/netstatus/flavoured.rs:27:10 > | > 27 | #[derive(Deftly, Clone, Debug)] > | ^^^^^^ the trait `parse2::traits::ItemValueParseable` is not implemented for `parse2::poc::netstatus::NdiParams` > ... > 55 | pub params: NdiParams, > | ------ required by a bound introduced by this call > | > = help: the following other types implement trait `parse2::traits::ItemValueParseable`: > () > (T0, T1) > (T0, T1, T2) > (T0, T1, T2, T3) > (T0, T1, T2, T3, T4) > (T0, T1, T2, T3, T4, T5) > (T0, T1, T2, T3, T4, T5, T6) > (T0, T1, T2, T3, T4, T5, T6, T7) > and 16 others > note: required by a bound in `parse2::multiplicity::ItemSetMethods::check_item_value_parseable` > --> crates/tor-netdoc/src/parse2/multiplicity.rs:109:59 > | > 109 | fn check_item_value_parseable(self) where Self::Each: ItemValueParseable {} > | ^^^^^^^^^^^^^^^^^^ required by this bound in `ItemSetMethods::check_item_value_parseable` > > error[E0277]: the trait bound `parse2::poc::netstatus::NdiParams: parse2::traits::ItemValueParseable` is not satisfied > --> crates/tor-netdoc/src/parse2/derive.rs:438:34 > | > 438 | let item = ItemValueParseable::from_unparsed(item)?; > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `parse2::traits::ItemValueParseable` is not implemented for `parse2::poc::netstatus::NdiParams` > | > ::: crates/tor-netdoc/src/parse2/poc/netstatus/flavoured.rs:27:10 > | > 27 | #[derive(Deftly, Clone, Debug)] > | ------ in this derive macro expansion > | > = help: the following other types implement trait `parse2::traits::ItemValueParseable`: > () > (T0, T1) > (T0, T1, T2) > (T0, T1, T2, T3) > (T0, T1, T2, T3, T4) > (T0, T1, T2, T3, T4, T5) > (T0, T1, T2, T3, T4, T5, T6) > (T0, T1, T2, T3, T4, T5, T6, T7) > and 16 others > = note: this error originates in the macro `derive_deftly_template_NetdocParseable` which comes from the expansion of the derive macro `Deftly` (in Nightly builds, run with -Z macro-backtrace for more info)