Files
dolt/nomdl/codegen/header.tmpl
Chris Masone eda9b92870 Rename types.TypeRef to types.Type
There are probably still a lot of variable names and comments to fix,
but this updates all the Go code.

Towards #441
2015-11-09 08:26:32 -08:00

27 lines
747 B
Cheetah

{{$typesPackage := .TypesPackage}}
// This file was generated by nomdl/codegen.
package {{.Name}}
import (
"github.com/attic-labs/noms/ref"
"github.com/attic-labs/noms/types"
)
{{if .HasTypes}}
var __{{.Name}}PackageInFile_{{.FileID}}_CachedRef ref.Ref
// This function builds up a Noms value that describes the type
// package implemented by this file and registers it with the global
// type package definition cache.
func init() {
p := {{$typesPackage}}NewPackage([]{{$typesPackage}}Type{ {{range $t := .Types}}
{{toTypesTypeRef $t "" ""}},{{end}}
}, []ref.Ref{ {{range $deps := .Dependencies}}
ref.Parse("{{$deps}}"),{{end}}
})
__{{.Name}}PackageInFile_{{.FileID}}_CachedRef = {{$typesPackage}}RegisterPackage(&p)
}
{{end}}