lang: Move the Arg type into the common interface package

This lets it get used in multiple places.
This commit is contained in:
James Shubin
2021-05-30 17:59:50 -04:00
parent 5fae5cd308
commit 453fe18d7f
4 changed files with 48 additions and 48 deletions

View File

@@ -438,6 +438,22 @@ func (obj *Scope) PullIndexes() ([]Expr, bool) {
return indexes, exists
}
// Arg represents a name identifier for a func or class argument declaration and
// is sometimes accompanied by a type. This does not satisfy the Expr interface.
type Arg struct {
Name string
Type *types.Type // nil if unspecified (needs to be solved for)
}
// String returns a short representation of this arg.
func (obj *Arg) String() string {
s := obj.Name
if obj.Type != nil {
s += fmt.Sprintf(" %s", obj.Type.String())
}
return s
}
// Edge is the data structure representing a compiled edge that is used in the
// lang to express a dependency between two resources and optionally send/recv.
type Edge struct {