Skip to main content

Crate praxis_input_parser

Crate praxis_input_parser 

Source
Expand description

The unified input parser DSL (§7, §14.1).

Responsibility (per the design): the parser-expression typed AST, the backtick template scanner, static validation, compile-time result-type synthesis, and parser-plan construction. The DSL has its own typed AST (§7.9) and is not lowered immediately into string-splitting calls.

The crate covers the atomics (AtomicKind::ALLint, uint, float, byte, char, digit, word, identifier, text, rest), the constructors (Constructor::ALLlines, sections, csv, ws, sep, grid, matrix, chars, one_of, block, choice, optional, scan, repeated), backtick templates, type synthesis, and plan lowering. The runtime interpreter lives in praxis-runtime::parser.

Re-exports§

pub use ast::ArgShape;
pub use ast::AtomicKind;
pub use ast::BlockItem;
pub use ast::CaptureName;
pub use ast::Constructor;
pub use ast::EmptySeparator;
pub use ast::InvalidCaptureName;
pub use ast::InvalidRepeatCount;
pub use ast::ParserAst;
pub use ast::RepeatCount;
pub use ast::SectionItem;
pub use ast::Separator;
pub use ast::SkipPolicy;
pub use ast::TemplatePart;
pub use ast::WsPolicy;
pub use call::CallArg;
pub use call::build_call;
pub use call::build_repeated_tail;
pub use plan::BlockItemNode;
pub use plan::CompiledPlan;
pub use plan::FieldOrder;
pub use plan::MAX_PLANS;
pub use plan::ParserPlan;
pub use plan::PlanId;
pub use plan::PlanNode;
pub use plan::SectionItemNode;
pub use plan::SourceOrder;
pub use plan::TemplatePartNode;
pub use plan::TemplateShape;
pub use plan::TooManyPlans;
pub use plan::get_plan;
pub use plan::lower_to_plan;
pub use plan::plan_count;
pub use plan::register_plan;
pub use plan::retire_all_plans;
pub use scan::ScanError;
pub use scan::scan_template;
pub use synthesize::synthesize;
pub use synthesize::synthesize_indexed;
pub use validate::ArgKind;
pub use validate::ValidationError;
pub use validate::check_call;
pub use validate::validate;

Modules§

ast
The typed AST of the input-parser DSL (§7.9).
body
The capture-body parser (§7.3, ADR-072).
call
Constructor calls: one argument list, one shape check, one builder (§7.5).
plan
Parser plans: the flat runtime representation of a parser AST.
scan
Interior re-scan of a backtick template (§7.2, §7.3).
synthesize
Compile-time result-type synthesis (§7.8).
validate
Static validation of a parser AST (§7.9 step 2).

Constants§

FILLED_AT_MILESTONE
Marker documenting that this crate is filled at Milestone 6.
MAX_NESTING
How deeply captures and nested templates may nest before the scanner refuses (D10).

Functions§

nearest_parser_name
The atomic or constructor name was probably meant to be (ADR-132).
parser_names
Every name a parser expression may begin with: §7.4’s atomics and §7.5’s constructors, in their own tables’ order.