aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/parse2/lex.rs
Commit message (Collapse)AuthorAgeFilesLines
* everywhere: Add #[allow(clippy::string_slice)]Clara Engler2026-06-091-0/+3
| | | | | | | | This commit adds #[allow(clippy::string_slice)] to all functions in the code where string slices are used, alongside a TODO comment. We do this add the function header to have it consistent, as things like expression based allow's are still experimental.
* tor-netdoc: Rename NetdocUnverified trait to NetdocParseableUnverifiedIan Jackson2026-06-021-1/+1
| | | | | | | | | | | | The NetdocParseableUnverified derive macro implements this trait (amongst other things). Traits and derive macros should have aligned names. This is only used for parsing, so let's keep the "Parseable" part of the name. I don't think the effort of deprecated alias, for downstream compatibility, is worth it, our compatibility policy notwithstanding.
* tor-netdoc: Properly replace parse2::lex::NoFurtherArgumentsIan Jackson2026-05-271-12/+2
| | | | | | | | | | | | | | | As pointed out in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413185 this was a duplicate. The new NoFurtherArguments * Implements encoding * Implements more traits * Is in the right module (types::misc - it's not just for parsing) * Has a slightly better name * Had an open-coded parsing impl (which we now replace) * Had minor differences to docs (so we add a line to NoFurtherArguments)
* Fix typosTobias Stoeckmann2026-03-241-3/+3
| | | | Typos found with codespell
* tor-netdoc: signature orderliness: change terminologyIan Jackson2026-03-191-2/+2
| | | | | | "Regular" is confusing, especially since in American English it tends to mean "usual" - whereas, there are no orderly signatures in Tor netdocs.
* tor-netdoc: parse2: Include body length in SignaturesDataIan Jackson2026-03-191-0/+2
| | | | | This could allow users to attach and detach signatures, hash (only) the body part, etc.
* tor-netdoc: parse2: Don't impl NetdocParseable for bodies of signed docsIan Jackson2026-03-191-4/+18
| | | | Such an impl is a footgun. Explain this in docs & comments.
* tor-netdoc: parse2: Don't impl NetdocParseable for bodies of signed docs ↵Ian Jackson2026-03-191-1/+4
| | | | (pre-fmt)
* tor-netdoc: parse2: Move hash out of signature itemsIan Jackson2026-03-191-1/+4
| | | | | | | | | | During encoding, including these hashes in the signature items makes no sense. The hashes are an *input* to the signature items, but not part of them. Move the hashes out of the items. Instead, provide each signatures section type with a hash accumulator type, in which the hash(es) are stored.
* tor-netdoc: parse2: SignatureHashInputs: Include document so farIan Jackson2026-03-191-0/+2
|
* tor-netdoc: parse2: Introduce SignatureData structIan Jackson2026-03-191-2/+5
| | | | This is going to contain body information, and the hashes, too.
* tor-netdoc: NetdocParseableSignatures: Make into its own traitIan Jackson2026-03-191-2/+2
|
* tor-netdoc: Rename *Signed to *UnverifiedIan Jackson2026-03-031-1/+1
| | | | | | | | | | This was a weird name, and while working in this area it all seemed to make the docs strange. Rename it. This is quite invasive! In theory we could have the macros generate compatibility aliases, but that seems quite complex.
* tor-netdoc: Expose whole input string (rustfmt)Ian Jackson2026-01-151-2/+1
|
* tor-netdoc: Expose whole input stringIan Jackson2026-01-151-8/+17
| | | | | | | | The string so far is exposed already via whole_for_signatures. It is unusual for a doc parser to need this, but embedded documents can use this plus byte_position to get the original input text for their part of the outer document.
* tor-netdoc: Break out and expose ItemStream::byte_positionIan Jackson2025-12-181-3/+10
|
* tor-netdoc: parse2: Introduce ParseOptions (fmt)Ian Jackson2025-11-181-1/+5
|
* tor-netdoc: parse2: Introduce ParseOptionsIan Jackson2025-11-181-7/+46
| | | | There are currently no options.
* tor-netdoc: parse2: Introduce ParseInput intermediate structIan Jackson2025-11-181-3/+3
| | | | | | | 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: Provide convenience method for handling invalid argumentsIan Jackson2025-10-151-0/+14
|
* tor-netdoc: parse2: Add column field as far as ErrorProblemIan Jackson2025-10-091-3/+30
| | | | | | | 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: Abolish now-obsolete field argument to from_argsIan Jackson2025-10-091-1/+1
|
* tor-netdoc: Introduce ArgumentErrorIan Jackson2025-10-091-1/+22
| | | | | 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-091-3/+3
| | | | | | | 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
|
* 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-091-8/+13
|
* tor-netdoc: parse2: Add whole_line_len to ArgumentStreamIan Jackson2025-10-091-3/+15
|
* tor-netdoc: parse2: Break out check_no_objectIan Jackson2025-10-061-0/+8
| | | | This will be useful for impls of ItemValueParseable.
* netdoc parse2: Fix "rest" item arguments, and testIan Jackson2025-09-291-2/+2
| | | | | The previous code didn't compile at all, and this went unnoticed because it wasn't used by the poc.
* tor-netdoc: Introduce parse2, new parserIan Jackson2025-08-141-0/+357
This isn't used anywhere yet. We're going to demonstrate it, and test the demo, in a moment.