aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/parse2
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-netdoc: parse2 derive: deduplicate item accumulationIan Jackson2025-11-101-31/+35
|
* tor-netdoc: parse2 derive: deduplicate item accumulation (prep)Ian Jackson2025-11-101-43/+54
| | | | | | | | | Move what is now IF_NONSTRUCTURAL_ACCUMULATE into the common module. It's not yet suitable for reuse. The docs for ACCUMULATE_ITEM_VALUE are still wrong. We'll fix that in a moment.
* tor-netdoc: parse2 derive: Provide dtrace in NetdocParseableFieldsIan Jackson2025-11-101-12/+21
| | | | | | This was previously only not done because of the need to c&p. Also, we're going to be expanding some common macros that will use it.
* tor-netdoc: parse2 derive: Get rid of $ITEM workaroundIan Jackson2025-11-101-10/+4
| | | | The hygiene is fixed in derive-deftly 1.5.x.
* tor-netdoc: Fix typoIan Jackson2025-11-101-1/+1
|
* tor-netdoc: parse2 derive: deduplicate item parsingIan Jackson2025-11-061-24/+23
|
* tor-netdoc: parse2 derive: deduplicate item set selectorsIan Jackson2025-11-061-47/+62
|
* tor-netdoc: parse2 derive: deduplicate F_EFFECTIVE_TYPEIan Jackson2025-11-061-24/+13
|
* tor-netdoc: parse2 derive: deduplication: field types and keywordsIan Jackson2025-11-061-36/+39
| | | | | | | Have the module expect the use site to determine (mostly) the field kind. Document this expectation. Now NetdocParseableCommon can have the keyword-related definitions.
* tor-netdoc: parse2 derive: deduplication: start a moduleIan Jackson2025-11-062-9/+13
| | | | Put one textually-identical define in it, to start with.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-062-2/+2
| | | | Run maint/add_warning
* Use a while let loop (to placate clippy)Ian Jackson2025-11-061-2/+1
|
* tor-netdoc: Add unit tests for NotPresent and Ignored objectsIan Jackson2025-10-231-1/+32
|
* tor-netdoc: Add unit tests for NotPresent itemsIan Jackson2025-10-231-0/+4
|
* tor-netcoc: Introduce NotPresent, for absent multiplicityIan Jackson2025-10-231-0/+11
| | | | | | | | | Currently this is mishandled: the current use sites (in rs/each_variety.rs) use Option<Ignored>, which would reject repeated items with that keyword, which is technically wrong. And encoing will become a problem. Vec<Ignored> would be wrong too. Instead, broaden NotPresent and give it multiplicity impls.
* tor-netdoc: Move parse2 impls on Ignored to types/misc.rsIan Jackson2025-10-231-22/+0
| | | | | | This seems to be where we're putting most of the parse2 impls on these types, now. That makes more sense as parse2 becomes more of a proper thing.
* tor-netdoc: NetdocParseableFields derive: support flatten (test)Ian Jackson2025-10-221-0/+11
|
* tor-netdoc: NetdocParseableFields derive: support flattenIan Jackson2025-10-221-2/+26
| | | | | | | | | This allows a NetdocParseableFields inside a NetdocParseableFields. The code is rather duplicative with the NetdocParseable implementation. This is due to limitations in derive-deftly; see https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/525 where I'm trying to start to address them.
* tor-netdoc: NetdocParseableFields derive: break out kw variableIan Jackson2025-10-221-1/+3
| | | | We're going to reuse this.
* Merge branch 'p2-misc-fixes' into 'main'opara2025-10-211-1/+5
|\ | | | | | | | | tor-netdoc: parse2: Minor fixes See merge request tpo/core/arti!3376
| * tor-netdoc: NetdocParseable derive: use more explicit syntaxIan Jackson2025-10-211-1/+1
| | | | | | | | In principle some other trait might be in scope.
| * tor-netdoc: parse2: Don't declare internal error on subdoc intro itemsIan Jackson2025-10-211-0/+4
| | | | | | | | | | subdoc intro items aren't inherently incoherent, but implementing them is nontrivial. Let's reject them with a bespoke error instead.
* | Merge branch 'p2-blanket-arc' into 'main'David Goulet2025-10-212-7/+30
|\ \ | | | | | | | | | | | | tor-netdoc: blanket impl parse2 traits for Arc See merge request tpo/core/arti!3381
| * | tor-netdoc: blanket impl parse2 traits for ArcIan Jackson2025-10-212-7/+30
| |/ | | | | | | This replaces one ad-hoc impl and will avoid having to have any more.
* / tor-netdoc: parse2: Provide documentation for derived Accumulator typesIan Jackson2025-10-211-0/+3
|/
* tor-netdoc: tests: Move vote parsing test to netstatus.rsIan Jackson2025-10-151-12/+0
| | | | | This is a test of real document structs now, albeit that it still uses one of the types from `poc`.
* tor-netdoc: tests: Use real `RouterStatus` in `parse2::poc`Ian Jackson2025-10-151-9/+7
| | | | This now exercises all the new parsing code.
* tor-netdoc: impl parse2 multiplicity for BTreeSetIan Jackson2025-10-152-1/+34
|
* tor-netdoc: impl parse2 traits for protoversIan Jackson2025-10-152-0/+24
|
* tor-netdoc: Provide convenience method for handling invalid argumentsIan Jackson2025-10-151-0/+14
|
* tor-netdoc: Replace NdaSystemTimeDeprecatedSyntax with Ios8601TimeSpIan Jackson2025-10-091-4/+5
| | | | | Previously we needed this separate type because Ios8601TimeSp is FromStr which prevented a correct ItemArgumentParseable impl.
* tor-netdoc: parse2: Fix some slips in doc commentsIan Jackson2025-10-091-3/+3
|
* tor-netdoc: parse2: Work around MSRV unhelpful lifetimeIan Jackson2025-10-091-2/+6
| | | | | | | | | | 1.85.1 rejects this, because it doesn't extend the lifetime of the `format_args!`. 1.90 is fine with it. I want to keep `format!` not `String::new()` so that it's easy to change back. That means a clippy allow. Getting that to apply to the code inside the derive is tricky, so I've enabled it for the whole module. (IMO this clippy lint is pretty annoying anyway.)
* tor-netdoc: parse2 tests: Test ParseError Display and Error implIan Jackson2025-10-091-6/+29
|
* tor-netdoc: parse2 tests: Have t_err_* return the errorIan Jackson2025-10-091-5/+4
|
* tor-netdoc: parse2 tests: Have t_err_* return the error (pre-fmt)Ian Jackson2025-10-091-1/+6
|
* tor-netdoc: parse2 tests: Check columnsIan Jackson2025-10-091-7/+15
|
* tor-netdoc: parse2 tests: Check columns (pre-fmt)Ian Jackson2025-10-091-1/+2
|
* tor-netdoc: parse2: Add column field to PaarsError and print itIan Jackson2025-10-091-2/+12
|
* tor-netdoc: parse2: Add .column() accessor to ErrorProblemIan Jackson2025-10-091-1/+28
| | | | We'll want to general way to find the error problem column.
* tor-netdoc: parse2: Add column field as far as ErrorProblemIan Jackson2025-10-092-7/+47
| | | | | | | Provide facilities in ArgumnetStream for determining the column, and add the field to all the error types up to and including ErrorProblem. The value still needs to be propagated to ParseError, and printed there.
* tor-netdoc: parse2: Replace EP with AE in derive fields rest pathIan Jackson2025-10-091-1/+2
|
* tor-netdoc: parse2: Replace EP with AE in NdiDirectorySignature (fmt)Ian Jackson2025-10-091-7/+10
|
* tor-netdoc: parse2: Replace EP with AE in NdiDirectorySignatureIan Jackson2025-10-091-4/+4
|
* tor-netdoc: Abolish now-obsolete field argument to from_args (fmt)Ian Jackson2025-10-094-29/+7
|
* tor-netdoc: Abolish now-obsolete field argument to from_argsIan Jackson2025-10-097-20/+11
|
* tor-netdoc: Introduce ArgumentError (fmt)Ian Jackson2025-10-091-3/+1
|
* tor-netdoc: Introduce ArgumentErrorIan Jackson2025-10-099-33/+84
| | | | | This will allow us to (1) move field name handling out of the argument parser method, and also (2) add columns more easily.
* tor-netdoc: Have .reject_extra_args return a bespoke errorIan Jackson2025-10-093-4/+19
| | | | | | | We're about to have some functions return ArgumentError and some ErrorProblem. We don't want to provide a conversion directly between these types, so instead introduce a new type that will be convertible to either.
* tor-netdoc: UnparsedItem: Provide .args() accessorIan Jackson2025-10-091-0/+7
|