Renamed method recievers from trait to node in node-traits

This commit is contained in:
Sasha Koshka 2022-09-27 14:18:46 -04:00
parent 873d6c89b1
commit 48325e224b
1 changed files with 16 additions and 16 deletions

View File

@ -10,19 +10,19 @@ type locatable struct {
}
// Location returns the location of the node.
func (trait locatable) Location () (location file.Location) {
location = trait.location
func (node locatable) Location () (location file.Location) {
location = node.location
return
}
// NewError creates a new error at the node's location.
func (trait locatable) NewError (
func (node locatable) NewError (
message string,
kind infoerr.ErrorKind,
) (
err error,
) {
err = infoerr.NewError(trait.location, message, kind)
err = infoerr.NewError(node.location, message, kind)
return
}
@ -32,8 +32,8 @@ type nameable struct {
}
// Name returns the name of the node.
func (trait nameable) Name () (name string) {
name = trait.name
func (node nameable) Name () (name string) {
name = node.name
return
}
// typeable allows a node to have a type.
@ -42,8 +42,8 @@ type typeable struct {
}
// Type returns the type of the node.
func (trait typeable) Type () (what Type) {
what = trait.what
func (node typeable) Type () (what Type) {
what = node.what
return
}
@ -53,8 +53,8 @@ type permissionable struct {
}
// Permission returns the permision of the node.
func (trait permissionable) Permission () (permission types.Permission) {
permission = trait.permission
func (node permissionable) Permission () (permission types.Permission) {
permission = node.permission
return
}
@ -64,8 +64,8 @@ type valuable struct {
}
// Value returns the value argument of the node.
func (trait valuable) Value () (value Argument) {
value = trait.value
func (node valuable) Value () (value Argument) {
value = node.value
return
}
@ -75,13 +75,13 @@ type multiValuable struct {
}
// Value returns the value at index.
func (trait multiValuable) Value (index int) (value Argument) {
value = trait.values[index]
func (node multiValuable) Value (index int) (value Argument) {
value = node.values[index]
return
}
// Length returns the amount of values in the mode.
func (trait multiValuable) Length () (length int) {
length = len(trait.values)
func (node multiValuable) Length () (length int) {
length = len(node.values)
return
}