Gherkin.Pickles (Cucumber v1.0.0)

View Source

Compiles a parsed Gherkin.Feature into its Cucumber Messages gherkinDocument node and the list of Gherkin.Pickles 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).

Summary

Functions

Compiles a feature into its gherkinDocument feature node and pickles.

Functions

compile(feature, start_id \\ 0)

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.