code: func (b *Bundle) Compile() (*template.Registry, error) {
  	if b.err != nil {
  		return nil, b.err
  	}
  
  	// Compile all the soy (globals are already parsed)
  	var registry = template.Registry{}
  	for _, soyfile := range b.files {
  		var tree, err = parse.SoyFile(soyfile.name, soyfile.content)
  		if err != nil {
  			return nil, err
  		}
  		if err = registry.Add(tree); err != nil {
  			return nil, err
  		}
  	}
  
  	// Apply the post-parse processing
  	for _, parsepass := range b.parsepasses {
  		if err := parsepass(registry); err != nil {
  			return nil, err
  		}
  	}
  	if err := parsepasses.CheckDataRefs(registry); err != nil {
  		return nil, err
  	}
  	if err := parsepasses.SetGlobals(registry, b.globals); err != nil {
  		return nil, err
  	}
  	parsepasses.ProcessMessages(registry)
  
  	if b.watcher != nil {
  		go b.recompiler(&registry)
  	}
  	return &registry, nil
  }
docs: // Compile parses all of the soy files in this bundle, verifies a number of
  // rules about data references, and returns the completed template registry.