Skip to main content

Crate formatparse_core

Crate formatparse_core 

Source
Expand description

formatparse-core: Core Rust library for parsing strings using Python format() syntax

This crate contains the pure Rust logic for pattern parsing, regex generation, and type definitions. It has no dependencies on Python or PyO3.

Re-exports§

pub use datetime::parse_microsecond_digits;
pub use indent_block::strip_common_indent;
pub use input_line_continuations::normalize_input_line_continuations;
pub use lookaround::parse_lookaround_tail;
pub use lookaround::reject_lookaround_in_strftime;
pub use lookaround::rewrite_field_fragments_for_engine_anchor;
pub use lookaround::split_type_base_and_lookaround_tail;
pub use parser::pattern::field_types_match;
pub use parser::pattern::parse_field;
pub use parser::pattern::parse_field_path;
pub use parser::pattern::parse_format_spec;
pub use parser::pattern::parse_pattern;
pub use parser::pattern::validate_multiline_mvp;
pub use parser::pattern::ParsedPatternParts;
pub use parser::pattern::MAX_NESTED_FORMAT_DEPTH;
pub use parser::count_capturing_groups;
pub use parser::validate_field_name;
pub use parser::validate_input_length;
pub use parser::validate_pattern_length;
pub use parser::MAX_FIELDS;
pub use parser::MAX_FIELD_NAME_LENGTH;
pub use parser::MAX_INPUT_LENGTH;
pub use parser::MAX_PATTERN_LENGTH;
pub use types::regex::strftime_to_regex;
pub use types::FieldSpec;
pub use types::FieldType;
pub use parser::regex::*;

Modules§

datetime
Pure datetime-related string parsing (no PyO3).
error
Error types for formatparse-core
indent_block
Strip common leading indentation from a captured block (GitHub issue #69).
input_line_continuations
Backslash–newline continuations in matched input for :ml / :blk fields (GitHub issue #80).
lookaround
Trailing regex lookaround assertions in format type tails (issue #9 / parse#209).
parser
types
Type definitions for field specifications