Documentation
¶
Overview ¶
Package gen orchestrates generation: it drives parsing, naming, lowering, and emission for every package matched by the CLI's patterns.
Index ¶
Constants ¶
View Source
const LawsTestSuffix = "_gpp_laws_test.go"
LawsTestSuffix names generated law-test files.
Variables ¶
This section is empty.
Functions ¶
func GenSiblings ¶ added in v0.10.0
GenSiblings computes the derivable-enum name set for one package.
func RenderEnumGen ¶ added in v0.10.0
RenderEnumGen renders Gen<Enum> and its depth helper. qual prefixes constructor and type references when the generator is emitted outside the enum's package ("" for same-package). ok is false when the enum cannot derive a generator (generic, indexed, or uninhabited at any depth).
Types ¶
type Options ¶
type Options struct {
Dir string // working directory; resolved against pattern paths
Patterns []string // go-style package patterns; default ["./..."]
Check bool // verify only: report stale outputs, write nothing
Stage bool // after writing, git-add changed/deleted outputs
// Overlay substitutes in-memory contents for on-disk .gpp files
// (absolute path → bytes) — the LSP's unsaved buffers.
Overlay map[string][]byte
// DryRun computes diagnostics and outputs without writing anything
// (and without staging or orphan deletion).
DryRun bool
}
Options configures a generation run.
type Result ¶
type Result struct {
Written []string // files written (or deleted orphans, in write mode)
Stale []string // check mode: outputs missing or out of date
Orphans []string // generated files whose .gpp source is gone
Outputs map[string][]byte // DryRun: would-be generated content
Diags []diag.Diagnostic
}
Result reports what a run did (paths relative to Options.Dir when under it).
Click to show internal directories.
Click to hide internal directories.