FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    character_reader

    module · ferroui-base · v0.5.0

    module character_reader
    

    Forward-only character reader used by the hand-written grammars (binding expressions, selectors, property paths, container queries).

    The reader works on Unicode scalar values (char) over a UTF-8 &str.

    Differences from the upstream reader, which works on UTF-16 code units:

    • CharacterReader::position and the count arguments are measured in chars. For text in the Basic Multilingual Plane this is identical to upstream; a supplementary-plane character counts as one instead of two.
    • Reading at the end of the input never fails: CharacterReader::peek and CharacterReader::take return None and the take_if* methods return false, where upstream raises an index-out-of-range error. Grammars turn the resulting state into a parse error.

    The module also hosts the character classification helpers the grammars share (is_white_space, is_letter, is_digit).

    View source

    Contents

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.