Documentation
¶
Overview ¶
Package genplan packs generated declaration chunks into deterministic, meaningfully named part files. It is the shared planner behind the GIR generators (girgen, webkitgen) and mirrors the j2go FilePlanner contract: chunks group by name family, consecutive groups fill a part up to the target line count, a part never exceeds the ceiling except for a single indivisible chunk, and part names carry the sanitized group name, never an opaque part number.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chunk ¶
type Chunk struct {
Group string // name family the part file is named after
Owner string // disambiguator basis when a group is split across parts
Text string
}
Chunk is one emitted declaration plus its name family. Relatives (overloads, the members of one widget family) share a Group so they stay in one file.
type Part ¶
Part is the chunk set of one output file. Name is the sanitized file suffix; a caller writing a small output keeps its base file name instead of a suffix.
func Plan ¶
Plan packs chunks into ordered parts. Sorting is a total order (group, owner, text), so the plan is identical for any input permutation and across consecutive generation runs. targetLines is the fill aim per part; maxLines is the ceiling a same-group piece must fit into, except for a single indivisible chunk over it.