Skip to main content

Module ast

Module ast 

Source
Expand description

The typed AST of the input-parser DSL (§7.9).

The DSL has its own typed AST — the design (§7.9) forbids lowering parser expressions directly into string-splitting calls. The ordinary language parser produces rowan nodes; praxis-hir converts those into this ParserAst before validation, type synthesis, and plan construction.

The node set is §7.4’s ten atomics (AtomicKind), §7.5’s fourteen structural constructors (Constructor), and backtick templates with {name:parser} / {parser} captures (TemplatePart).

Structs§

CaptureName
The name of a template capture — an identifier by construction.
EmptySeparator
The one way Separator::new fails: the text was empty.
InvalidCaptureName
The one way CaptureName::parse fails: the text is not an identifier.
RepeatCount
The N of a repeated(P, N)at least one section, by construction.
Separator
The separator of a sep(separator, P) call — non-empty by construction.

Enums§

ArgShape
The shape of a constructor call’s argument list (§7.5).
AtomicKind
One of the atomic parsers (§7.4).
BlockItem
One item in a block(...) (§7.5).
Constructor
The name of a structural constructor — the whole of §7.5.
InvalidRepeatCount
The two ways RepeatCount::new fails.
ParserAst
A parser expression (§7.9 ParserExpr).
SectionItem
One named argument of a heterogeneous sections(...) other than its unbounded tail (§7.5).
SkipPolicy
How chars(P, skip:) trims between matches (§7.5).
TemplatePart
One part of a backtick template (§7.9 TemplatePart).
WsPolicy
How a template literal run of whitespace matches input (§7.2).

Functions§

shift_part_spans
Shift every span inside a template’s parts by delta bytes.