diff --git a/parser/argument.go b/parser/argument.go index c56a8d7..e821322 100644 --- a/parser/argument.go +++ b/parser/argument.go @@ -16,7 +16,7 @@ var validArgumentStartTokens = []lexer.TokenKind { } func (parser *ParsingOperation) parseArgument () (argument Argument, err error) { - argument.setLocation(parser.token.Location()) + argument.location = parser.token.Location() err = parser.expect(validArgumentStartTokens...) if err != nil { return } @@ -44,8 +44,8 @@ func (parser *ParsingOperation) parseArgument () (argument Argument, err error) declaration := Declaration { } declaration.what = what - declaration.setName(identifier.trail[0]) - declaration.setLocation(argument.Location()) + declaration.name = identifier.trail[0] + declaration.location = argument.Location() argument.kind = ArgumentKindDeclaration argument.value = declaration diff --git a/parser/data.go b/parser/data.go index e4ab680..9597972 100644 --- a/parser/data.go +++ b/parser/data.go @@ -12,7 +12,7 @@ func (parser *ParsingOperation) parseDataSection () ( if err != nil { return } section = &DataSection { } - section.setLocation(parser.token.Location()) + section.location = parser.token.Location() err = parser.nextToken(lexer.TokenKindPermission) if err != nil { return } diff --git a/parser/enum.go b/parser/enum.go index 5c4463c..80577a7 100644 --- a/parser/enum.go +++ b/parser/enum.go @@ -12,7 +12,7 @@ func (parser *ParsingOperation) parseEnumSection () ( if err != nil { return } section = &EnumSection { } - section.setLocation(parser.token.Location()) + section.location = parser.token.Location() // get permission err = parser.nextToken(lexer.TokenKindPermission) diff --git a/parser/face.go b/parser/face.go index 7cf715b..65e8372 100644 --- a/parser/face.go +++ b/parser/face.go @@ -15,7 +15,7 @@ func (parser *ParsingOperation) parseFaceSection () ( section = &FaceSection { behaviors: make(map[string] FaceBehavior), } - section.setLocation(parser.token.Location()) + section.location = parser.token.Location() // get permission err = parser.nextToken(lexer.TokenKindPermission) diff --git a/parser/func.go b/parser/func.go index 5477a16..feb5d13 100644 --- a/parser/func.go +++ b/parser/func.go @@ -13,7 +13,7 @@ func (parser *ParsingOperation) parseFuncSection () ( if err != nil { return } section = &FuncSection { } - section.setLocation(parser.token.Location()) + section.location = parser.token.Location() // get permission err = parser.nextToken(lexer.TokenKindPermission) diff --git a/parser/node-traits.go b/parser/node-traits.go index 3493aa6..d0e2df0 100644 --- a/parser/node-traits.go +++ b/parser/node-traits.go @@ -14,11 +14,6 @@ func (trait locatable) Location () (location file.Location) { return } -// setLocation sets the location of the node. -func (trait* locatable) setLocation (location file.Location) { - trait.location = location -} - // NewError creates a new error at the node's location. func (trait locatable) NewError ( message string, @@ -39,11 +34,6 @@ func (trait nameable) Name () (name string) { name = trait.name return } -// setName sets the name of the node. -func (trait *nameable) setName (name string) { - trait.name = name -} - // typeable allows a node to have a type. type typeable struct { what Type @@ -53,8 +43,3 @@ type typeable struct { func (trait typeable) Type () (what Type) { return trait.what } - -// setType sets the type of the node. -func (trait *typeable) setType (what Type) () { - -} diff --git a/parser/objt.go b/parser/objt.go index 9603959..8e40715 100644 --- a/parser/objt.go +++ b/parser/objt.go @@ -14,7 +14,7 @@ func (parser *ParsingOperation) parseObjtSection () ( if err != nil { return } section = &ObjtSection { } - section.setLocation(parser.token.Location()) + section.location = parser.token.Location() // get permission err = parser.nextToken(lexer.TokenKindPermission) diff --git a/parser/type.go b/parser/type.go index b6620c2..cacc3b0 100644 --- a/parser/type.go +++ b/parser/type.go @@ -14,7 +14,7 @@ func (parser *ParsingOperation) parseTypeSection () ( if err != nil { return } section = &TypeSection { } - section.setLocation(parser.token.Location()) + section.location = parser.token.Location() // get permission err = parser.nextToken(lexer.TokenKindPermission)