pub mod ast;
pub mod body;
pub mod call;
pub mod plan;
pub mod scan;
pub mod synthesize;
pub mod validate;
pub use ast::{
ArgShape, AtomicKind, BlockItem, CaptureName, Constructor, EmptySeparator, InvalidCaptureName,
InvalidRepeatCount, ParserAst, RepeatCount, SectionItem, Separator, SkipPolicy, TemplatePart,
WsPolicy,
};
pub use call::{CallArg, build_call, build_repeated_tail};
pub use plan::{
BlockItemNode, CompiledPlan, FieldOrder, MAX_PLANS, ParserPlan, PlanId, PlanNode,
SectionItemNode, SourceOrder, TemplatePartNode, TemplateShape, TooManyPlans, get_plan,
lower_to_plan, plan_count, register_plan, retire_all_plans,
};
pub use scan::{MAX_NESTING, ScanError, scan_template};
pub use synthesize::{synthesize, synthesize_indexed};
pub use validate::{ArgKind, ValidationError, check_call, validate};
pub const FILLED_AT_MILESTONE: u32 = 6;
pub fn parser_names() -> impl Iterator<Item = &'static str> {
AtomicKind::ALL
.iter()
.map(|a| a.keyword())
.chain(Constructor::ALL.iter().map(|c| c.keyword()))
}
#[must_use]
pub fn nearest_parser_name(name: &str) -> Option<&'static str> {
praxis_source::nearest(name, parser_names())
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn milestone_marker_is_six() {
assert_eq!(FILLED_AT_MILESTONE, 6);
}
}