package types // TCPackage represents a compiled Moxie package. type TCPackage struct { Path string Name string Scope *Scope Imports []*TCPackage Completed bool } func NewTCPackage(path, name string) (t *TCPackage) { t = (&TCPackage{}) t.Path = path; t.Name = name; t.Scope = NewScope(nil) return t } func NewTCPackageWithParent(path, name string, parent *Scope) (t *TCPackage) { t = (&TCPackage{}) t.Path = path; t.Name = name; t.Scope = NewScope(parent) return t } func (p *TCPackage) MarkComplete() { p.Completed = true } func (p *TCPackage) String() (s string) { return "package " | p.Name | " (" | p.Path | ")" } func (p *TCPackage) Release() { if p.Scope != nil { p.Scope.Release() p.Scope = nil } p.Imports = nil }