# `JsonRemedy.Layer3.BinaryProcessors`
[🔗](https://github.com/nshkrdotcom/json_remedy/blob/v0.2.1/lib/json_remedy/layer3/binary_processors.ex#L1)

Binary pattern matching optimization functions for Layer 3 syntax normalization.

Contains optimized binary processing functions that eliminate String.at/2 calls
for maximum performance.

# `analyze_and_normalize_number`
[🔗](https://github.com/nshkrdotcom/json_remedy/blob/v0.2.1/lib/json_remedy/layer3/binary_processors.ex#L319)

```elixir
@spec analyze_and_normalize_number(String.t(), non_neg_integer()) ::
  {String.t(), list()}
```

Analyze a consumed number string and normalize it appropriately.

Returns `{normalized_value, repairs}` where normalized_value is either:
- A valid number string that JSON can parse
- A quoted string for invalid number patterns

# `check_for_multi_word_value`
[🔗](https://github.com/nshkrdotcom/json_remedy/blob/v0.2.1/lib/json_remedy/layer3/binary_processors.ex#L487)

```elixir
@spec check_for_multi_word_value(binary(), String.t()) ::
  {String.t(), binary(), non_neg_integer()}
```

Check if there's more content after an identifier that should be part of an unquoted value.
This handles cases like "Weiss Savage" where there are spaces between words.

# `consume_identifier_binary_simple`
[🔗](https://github.com/nshkrdotcom/json_remedy/blob/v0.2.1/lib/json_remedy/layer3/binary_processors.ex#L198)

```elixir
@spec consume_identifier_binary_simple(binary()) ::
  {String.t(), binary(), non_neg_integer()}
```

Binary pattern matching for identifier consumption - UTF-8 safe.

# `consume_number_binary_simple`
[🔗](https://github.com/nshkrdotcom/json_remedy/blob/v0.2.1/lib/json_remedy/layer3/binary_processors.ex#L216)

```elixir
@spec consume_number_binary_simple(binary()) ::
  {String.t(), binary(), non_neg_integer()}
```

Binary pattern matching for number consumption (legacy - kept for compatibility).

# `consume_number_with_edge_cases`
[🔗](https://github.com/nshkrdotcom/json_remedy/blob/v0.2.1/lib/json_remedy/layer3/binary_processors.ex#L240)

```elixir
@spec consume_number_with_edge_cases(binary()) ::
  {String.t(), binary(), non_neg_integer()}
```

Enhanced number consumption that handles edge cases.

Consumes characters that could be part of a number, including:
- Standard number chars: digits, `.`, `-`, `+`, `e`, `E`
- Edge case chars: `/` (fractions), multiple `-` (ranges), text (hybrids), unicode
- Currency symbols: `$`, `€`, `£`, `¥` (at start)
- Commas: `,` (when already consuming digits - for European decimals or thousands)

Returns the raw consumed string which will be analyzed separately.

# `consume_unquoted_value_binary_simple`
[🔗](https://github.com/nshkrdotcom/json_remedy/blob/v0.2.1/lib/json_remedy/layer3/binary_processors.ex#L463)

```elixir
@spec consume_unquoted_value_binary_simple(binary(), binary(), non_neg_integer()) ::
  {String.t(), binary(), non_neg_integer()}
```

Consume an unquoted value until the next JSON delimiter.
This handles unquoted string values that may contain spaces.

# `determine_expecting_after_close_simple`
[🔗](https://github.com/nshkrdotcom/json_remedy/blob/v0.2.1/lib/json_remedy/layer3/binary_processors.ex#L21)

```elixir
@spec determine_expecting_after_close_simple(list()) :: atom()
```

Determine expecting state after closing delimiters.

# `determine_next_expecting_simple`
[🔗](https://github.com/nshkrdotcom/json_remedy/blob/v0.2.1/lib/json_remedy/layer3/binary_processors.ex#L15)

```elixir
@spec determine_next_expecting_simple(atom(), list()) :: atom()
```

Determine next expecting state after simple transitions.

# `process_identifier_binary_simple`
[🔗](https://github.com/nshkrdotcom/json_remedy/blob/v0.2.1/lib/json_remedy/layer3/binary_processors.ex#L42)

```elixir
@spec process_identifier_binary_simple(
  binary(),
  iolist(),
  list(),
  boolean(),
  boolean(),
  String.t() | nil,
  list(),
  atom(),
  non_neg_integer()
) ::
  {binary(), iolist(), list(), boolean(), boolean(), String.t() | nil, list(),
   atom(), non_neg_integer()}
```

Process identifiers with binary pattern matching.

# `process_number_binary_simple`
[🔗](https://github.com/nshkrdotcom/json_remedy/blob/v0.2.1/lib/json_remedy/layer3/binary_processors.ex#L172)

```elixir
@spec process_number_binary_simple(
  binary(),
  iolist(),
  list(),
  boolean(),
  boolean(),
  String.t() | nil,
  list(),
  atom(),
  non_neg_integer()
) ::
  {binary(), iolist(), list(), boolean(), boolean(), String.t() | nil, list(),
   atom(), non_neg_integer()}
```

Process numbers with binary pattern matching and edge case handling.

Handles:
- Fractions: `1/3` → `"1/3"`
- Ranges: `10-20` → `"10-20"`
- Invalid decimals: `1.1.1` → `"1.1.1"`
- Leading decimals: `.25` → `0.25`
- Text-number hybrids: `1notanumber` → `"1notanumber"`
- Trailing operators: `1e`, `1.` → normalize
- Unicode/currency: `123€` → `"123€"`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
