# `Gherkin.Pickles`
[🔗](https://github.com/huddlz-hq/cucumber/blob/main/lib/gherkin/pickles.ex#L103)

Compiles a parsed `Gherkin.Feature` into its Cucumber Messages
`gherkinDocument` node and the list of `Gherkin.Pickle`s to execute.

This module is the single expansion authority: scenario outlines expand
to one pickle per examples row (placeholders substituted in step text,
docstrings, datatables, and the pickle name), and scenarios inside
rules inherit the rule's background steps and tags. The test compiler
generates one test per pickle; the messages layer (#28) serializes the
document and pickles.

Every AST node the messages format identifies (background, scenario,
rule, step, tag, examples, table row) receives a deterministic
sequential string id, assigned in document order; pickles and pickle
steps continue the same sequence. Ids are unique within one `compile/2`
call — callers emitting several documents thread `next_id` through.

The parser tracks lines but not columns, so locations carry only
`line`. Table rows, docstrings, and tags carry their real source lines
as recorded by the parser (with an owner-derived fallback for
hand-built ASTs).

# `compile`

```elixir
@spec compile(map(), non_neg_integer()) :: Gherkin.Pickles.Compilation.t()
```

Compiles a feature into its gherkinDocument feature node and pickles.

`feature` is a `Gherkin.Feature` (or the map form discovery produces,
carrying `:file`). Ids start at `start_id`; the returned `next_id`
allows threading a run-wide sequence across documents.

---

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