Add functions to codegen.go for generating dependency code

This adds code for finding imported type packages and generating
code for them, but does not yet handle generating code that uses
those types.

Towards issue #294
This commit is contained in:
Chris Masone
2015-10-04 17:55:45 -04:00
parent 096ac4a224
commit 3dc61b673c
6 changed files with 334 additions and 41 deletions
+4 -4
View File
@@ -9,10 +9,10 @@ import (
"github.com/attic-labs/noms/types"
)
// ParseNomDL reads a Noms package specification from r and returns a Package. Errors will be annotated with logname and thrown.
func ParseNomDL(logname string, r io.Reader, cs chunks.ChunkSource) Parsed {
i := runParser(logname, r)
// ParseNomDL reads a Noms package specification from r and returns a Package. Errors will be annotated with packageName and thrown.
func ParseNomDL(packageName string, r io.Reader, cs chunks.ChunkSource) Parsed {
i := runParser(packageName, r)
i.Name = packageName
aliases := resolveImports(i)
depRefs := types.SetOfRefOfPackageDef{}
for _, target := range aliases {