# `Unicode.Transform.Compiler`
[🔗](https://github.com/elixir-unicode/unicode_transform/blob/v1.1.0/lib/unicode/transform/compiler.ex#L1)

Compiles parsed transform rules into an executable form.

The compiler takes a list of parsed rule structs and a direction,
and produces a `CompiledTransform` that can be executed by the engine.

Compilation involves:

* Filtering rules by direction (forward vs inverse).

* Resolving variable definitions.

* Grouping conversion rules into passes (split by transform rules).

* Compiling patterns for efficient matching.

# `compile`

```elixir
@spec compile([struct()], :forward | :reverse, function(), map()) ::
  Unicode.Transform.Compiler.CompiledTransform.t()
```

Compiles a list of parsed rules into an executable form.

### Arguments

* `rules` — list of parsed rule structs.

* `direction` — `:forward` or `:reverse`.

* `resolve_transform` — function to resolve transform names.

### Returns

A CompiledTransform struct.

# `compile_builtin`

```elixir
@spec compile_builtin(String.t(), :forward | :reverse) ::
  Unicode.Transform.Compiler.CompiledTransform.t()
```

Compiles a built-in transform.

### Arguments

* `name` — the built-in transform name.

* `direction` — `:forward` or `:reverse`.

### Returns

A CompiledTransform struct with a single builtin pass.

---

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