lang: Improve empty scope and output

For some reason these were unnecessary methods on the structs, even when
those structs contained nothing useful to offer.
This commit is contained in:
James Shubin
2018-11-22 16:01:59 -05:00
parent 3d06775ddc
commit a7c9673bcf
2 changed files with 18 additions and 12 deletions

View File

@@ -88,9 +88,9 @@ type Scope struct {
Chain []Stmt // chain of previously seen stmt's
}
// Empty returns the zero, empty value for the scope, with all the internal
// EmptyScope returns the zero, empty value for the scope, with all the internal
// lists initialized appropriately.
func (obj *Scope) Empty() *Scope {
func EmptyScope() *Scope {
return &Scope{
Variables: make(map[string]Expr),
//Functions: ???,
@@ -146,9 +146,9 @@ type Output struct { // returned by Stmt
//Exported []*Exports // TODO: add exported resources
}
// Empty returns the zero, empty value for the output, with all the internal
// lists initialized appropriately.
func (obj *Output) Empty() *Output {
// EmptyOutput returns the zero, empty value for the output, with all the
// internal lists initialized appropriately.
func EmptyOutput() *Output {
return &Output{
Resources: []engine.Res{},
Edges: []*Edge{},