From 48325e224bc8e7f15ab27ea18ac535067ffb2c5f Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 27 Sep 2022 14:18:46 -0400 Subject: [PATCH] Renamed method recievers from trait to node in node-traits --- parser/node-traits.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/parser/node-traits.go b/parser/node-traits.go index 6feeb0d..34fafd7 100644 --- a/parser/node-traits.go +++ b/parser/node-traits.go @@ -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 }