# character_reader

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/utilities/character_reader/

**module** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
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
  `char`s. 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`](/docs/0.5.0/api/ferroui-base/utilities/character_reader/function-is_white_space/), [`is_letter`](/docs/0.5.0/api/ferroui-base/utilities/character_reader/function-is_letter/), [`is_digit`](/docs/0.5.0/api/ferroui-base/utilities/character_reader/function-is_digit/)).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/character_reader.rs#L1)

## Contents

- [`is_white_space`](/docs/0.5.0/api/ferroui-base/utilities/character_reader/function-is_white_space/) — function
- [`is_letter`](/docs/0.5.0/api/ferroui-base/utilities/character_reader/function-is_letter/) — function
- [`is_digit`](/docs/0.5.0/api/ferroui-base/utilities/character_reader/function-is_digit/) — function
- [`CharacterReader`](/docs/0.5.0/api/ferroui-base/utilities/character_reader/struct-characterreader/) — struct

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
