# `ToonEx.Decode.Fast.Decoder`
[🔗](https://github.com/ohhi-vn/toon_ex/blob/v1.1.0/lib/toon_ex/decode/fast/decoder.ex#L1)

High-performance TOON decoder using pure binary pattern matching.

## Performance Design

1. **No NimbleParsec** – direct binary pattern matching replaces parser combinator overhead
2. **No regex in hot paths** – binary pattern matching replaces all regex in the decode loop
3. **Line-by-line processing** – tail-recursive accumulators with `:lists.reverse/1`
4. **Zero-copy slicing** – `binary_part/3` creates O(1) sub-binary references
5. **Erlang BIFs** – `:binary.split/3`, `:binary.match/2`, `:maps.from_list/1`
6. **Compile-time inlining** – `@compile {:inline, [...]}` for all hot functions
7. **Minimal allocations** – tuple line info `{content, indent, is_blank}` instead of maps
8. **Fast-path splitting** – `:binary.split/3` when no quotes present; quote-aware fallback
9. **Skip metadata** – no MapSet/key_order tracking when `expand_paths` is off (default)

# `decode`

```elixir
@spec decode(
  binary(),
  keyword()
) :: {:ok, term()} | {:error, ToonEx.DecodeError.t()}
```

# `decode!`

```elixir
@spec decode!(
  binary(),
  keyword()
) :: term()
```

---

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