Skip to main content

Module parse

Module parse 

Source
Expand description

srv’s and mcp’s parser of deep links (docs/specs/SPEC_DEEP_LINKS_ONE_FRAMEWORK_2026_11_20.md §3.2, R6 to R9, G7, G8). The app has the same parser in TypeScript (frontend/app/deeplinks/parse.ts); both are written from the one grammar and the one registry, and both run crates/common/deeplinks/conformance.json. A change here is a change there.

The order of the checks is part of the contract, so both sides give the same reason for the same link:

  1. length, then the scheme;
  2. the shape: view, segments, query and anchor, no empty part;
  3. each part, left to right: its characters, its percent-encoding (decoded once), control characters, its one written form;
  4. the view (an alias is rewritten first), its build, the place, host, the parameters, the anchor.

Structs§

ParsedLink
A link read: its view, the place it matched, the values of the place’s vars, its parameters and anchor.

Enums§

LinkError
Why a link is refused. as_str is the code the conformance file names.
Value
A value of a var or a parameter: a number for an int, text for every other kind.

Constants§

HOST_PARAM
The parameter every link may take, last: the computer its place is on, machine[/channel], lower case.
SCHEME

Functions§

encode_part
The one percent-encoding of text (R7): unreserved characters as they are, every other byte as %HH, upper case.
format_link
The one written form of a destination (R7). values holds package for a widget.
is_control
C0 and C1 controls, DEL, the bidirectional marks, embeddings, overrides and isolates, zero-width characters (G8).
parse_link
Reads link against the registry.
parse_link_in
Reads link against reg: the destination it names, or why it is refused (R8).
path_problem
Why path may not be opened by a link, as a structural check both sides make the same way (G7), or None. srv applies the rest of G7 (what the caller may read, where a symbolic link leads) when the link is opened.