# `Choreo.Lab.DSL.Compiler`
[🔗](https://github.com/code-shoily/choreo/blob/v0.14.1/lib/choreo/lab/dsl/compiler.ex#L1)

Shared helper functions for Choreo Lab DSL compilers.

This module encapsulates AST parsing and utility operations used during macro expansion
of the experimental diagram DSLs.

# `compile_block_statements`

```elixir
@spec compile_block_statements(Macro.t(), any(), (Macro.t(), any() -&gt; {any(), any()})) ::
  {any(), any()}
```

Recursively compiles all statements in a block using a provided processor function.

# `extract_do_block`

```elixir
@spec extract_do_block(Macro.t()) :: {Macro.t() | nil, Macro.t() | nil}
```

Extracts a `do` block from a constructor statement (assigned or inline).
Returns `{block, stripped_statement}` or `{nil, nil}`.

# `line_meta`

```elixir
@spec line_meta(Macro.t()) :: keyword()
```

Extracts line metadata from an AST node.

# `line_suffix`

```elixir
@spec line_suffix(keyword()) :: String.t()
```

Formats a line number suffix for error messages.

# `pop_do_block`

```elixir
@spec pop_do_block([any()]) :: {Macro.t() | nil, [any()]}
```

Pops a `do` block from an argument list.

# `pop_trailing_opts`

```elixir
@spec pop_trailing_opts([any()]) :: {keyword(), [any()]}
```

Pops trailing options (a keyword list) from an argument list.

# `slug_atom`

```elixir
@spec slug_atom(String.t() | atom()) :: atom()
```

Derives a snake_case atom from a string or atom label.

# `statements`

```elixir
@spec statements(Macro.t()) :: [Macro.t()]
```

Unwraps a block or single statement into a list of statements.

# `unwrap_pipe`

```elixir
@spec unwrap_pipe(Macro.t(), [Macro.t()]) :: {Macro.t(), [Macro.t()]}
```

Unwraps a pipeline of modifications.

---

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