codejen: Update to latest codejen (#58866)

This commit is contained in:
sam boyer
2022-11-16 15:08:01 -05:00
committed by GitHub
parent 88f5ed0faf
commit c4528f9bd8
8 changed files with 17 additions and 11 deletions
+8
View File
@@ -34,12 +34,20 @@ func ForGen(rt *thema.Runtime, decl *kindsys.SomeDecl) (*DeclForGen, error) {
type DeclForGen struct {
*kindsys.SomeDecl
lin thema.Lineage
sch thema.Lineage
}
// Lineage returns the [thema.Lineage] for the underlying [kindsys.SomeDecl].
func (decl *DeclForGen) Lineage() thema.Lineage {
return decl.lin
}
// Schema returns the [thema.Schema] that a jenny should operate against, for those
// jennies that target a single schema.
func (decl *DeclForGen) Schema() thema.Lineage {
return decl.sch
}
// SlashHeaderMapper produces a FileMapper that injects a comment header onto
// a [codejen.File] indicating the main generator that produced it (via the provided
// maingen, which should be a path) and the jenny or jennies that constructed the
+1 -1
View File
@@ -31,7 +31,7 @@ func (gen *genBaseRegistry) JennyName() string {
return "BaseCoreRegistryJenny"
}
func (gen *genBaseRegistry) Generate(decls []*DeclForGen) (*codejen.File, error) {
func (gen *genBaseRegistry) Generate(decls ...*DeclForGen) (*codejen.File, error) {
var numRaw int
for _, k := range decls {
if k.IsRaw() {
+1 -1
View File
@@ -39,7 +39,7 @@ func (gen *genTSVeneerIndex) JennyName() string {
return "TSVeneerIndexJenny"
}
func (gen *genTSVeneerIndex) Generate(decls []*DeclForGen) (*codejen.File, error) {
func (gen *genTSVeneerIndex) Generate(decls ...*DeclForGen) (*codejen.File, error) {
tsf := new(ast.File)
for _, decl := range decls {
if decl.IsRaw() {