summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/parse2
Commit message (Collapse)AuthorAgeFilesLines
* parse2: Move naming convention to pocClara Engler2025-11-271-1/+15
| | | | | | | | | | | This commit moves the "Naming Convention" of the parse2::poc module into the respective module, as it does not apply to parse2 itself, as outlined in arti!3462. With this commit, there remains `NdaSystemTimeDeprecatedSyntax` as the only type outside poc following this naming schema. However, because it is more or less already deprecated anyways, there is no real need to bother with it any further.
* tor-netdoc: Minor wording fix in a docIan Jackson2025-11-261-1/+1
| | | | | This is in the ItemValueParseable derive, so the individual fields are Arguments, not Items.
* tor-netdoc: Minor grammar fix in a docIan Jackson2025-11-261-1/+1
|
* Merge branch 'nd-test' into 'main'Ian Jackson2025-11-251-747/+0
|\ | | | | | | | | tor-netdoc: Move parse2/test.rs to test2.rs See merge request tpo/core/arti!3486
| * tor-netdoc: Move parse2/test.rs to test2.rsIan Jackson2025-11-241-747/+0
| | | | | | | | | | | | | | We're going to use this for the encoder testing too, so it needs to be not buried inside parse2. This commit is the file rename plus minimal changes to make it compile.
* | Merge branch 'p2-mult' into 'main'Ian Jackson2025-11-253-66/+48
|\ \ | |/ |/| | | | | tor-netdoc: parse2: Combine MultiplicitySelector See merge request tpo/core/arti!3478
| * tor-netdoc: rustfmt to tidy up importsIan Jackson2025-11-191-4/+1
| |
| * tor-netdoc: parse2: Combine all the multiplicity SelectorsIan Jackson2025-11-193-49/+34
| | | | | | | | | | There is no conflict between the different uses. Having just one type makes things simpler.
| * tor-netdoc: parse2: Move multiplicity docs examples into Methods traitsIan Jackson2025-11-191-32/+32
| | | | | | | | | | | | | | We're going to combine all the Selector types, so it won't be able to have these. The diff is misleading: it's docs for the Selectors that's moving.
* | tor-netdoc: parse2 docs: Clarify that these are for parsingIan Jackson2025-11-191-3/+3
| | | | | | | | We're going to have separate traits for encoding.
* | tor-netdoc: parse2 docs: Fix ItemObjectParseableIan Jackson2025-11-191-4/+1
| | | | | | | | Once upon a time this trait handled multiplicity. But it doesn't any more.
* | tor-netdoc: parse2 docs: Improve `#[deftly(netdoc(rest))]` docsIan Jackson2025-11-191-0/+2
| |
* | tor-netdoc: parse2 docs: Fix docs for ItemArgumentParseableIan Jackson2025-11-191-3/+2
| | | | | | | | This is not impl for all FromStr. We have NormalItemArgument now.
* | tor-netdoc: parse2 docs: Document BTreeSet in multiplicityIan Jackson2025-11-191-2/+3
|/ | | | This was added at some point, but not documented.
* tor-netdoc: Introduce Unknown and retain_unknown_values optionIan Jackson2025-11-181-0/+1
|
* tor-netdoc: parse2: Introduce ParseOptions (fmt)Ian Jackson2025-11-181-1/+5
|
* tor-netdoc: parse2: Introduce ParseOptionsIan Jackson2025-11-182-8/+48
| | | | There are currently no options.
* tor-netdoc: parse2: Introduce ParseInput intermediate structIan Jackson2025-11-185-16/+27
| | | | | | | We're going to add options arguments, effectively, to the parsing entrypoints. To avoid a proliferation of entrypoints (eg, parse_multiple_with_options), encapsulate the run-time input values in this structure.
* tor-netdoc: parse2: Improve error message when using with=Ian Jackson2025-11-101-1/+1
| | | | | This can result in "trait not implemented" errors here. Use the `${paste_spanned}` trick.
* tor-netdoc: parse2 derive: deduplicate completionIan Jackson2025-11-101-35/+33
|
* 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
|