Skip to main content

formatparse_core/
lib.rs

1//! formatparse-core: Core Rust library for parsing strings using Python format() syntax
2//!
3//! This crate contains the pure Rust logic for pattern parsing, regex generation,
4//! and type definitions. It has no dependencies on Python or PyO3.
5
6pub mod datetime;
7pub mod error;
8pub mod indent_block;
9pub mod input_line_continuations;
10pub mod lookaround;
11pub mod parser;
12pub mod types;
13
14pub use datetime::parse_microsecond_digits;
15pub use indent_block::strip_common_indent;
16pub use input_line_continuations::normalize_input_line_continuations;
17pub use lookaround::{
18    parse_lookaround_tail, reject_lookaround_in_strftime,
19    rewrite_field_fragments_for_engine_anchor, split_type_base_and_lookaround_tail,
20};
21pub use parser::pattern::{
22    field_types_match, parse_field, parse_field_path, parse_format_spec, parse_pattern,
23    validate_multiline_mvp, ParsedPatternParts, MAX_NESTED_FORMAT_DEPTH,
24};
25pub use parser::{
26    count_capturing_groups, validate_field_name, validate_input_length, validate_pattern_length,
27    MAX_FIELDS, MAX_FIELD_NAME_LENGTH, MAX_INPUT_LENGTH, MAX_PATTERN_LENGTH,
28};
29
30pub use parser::regex::*;
31pub use types::regex::strftime_to_regex;
32pub use types::{FieldSpec, FieldType};