Removed many cringe pass-by-references
This commit is contained in:
parent
f3c72f8f30
commit
691df94ef4
@ -3,8 +3,6 @@ package parser
|
|||||||
import "git.tebibyte.media/arf/arf/lexer"
|
import "git.tebibyte.media/arf/arf/lexer"
|
||||||
import "git.tebibyte.media/arf/arf/infoerr"
|
import "git.tebibyte.media/arf/arf/infoerr"
|
||||||
|
|
||||||
// TODO: parser must ensure that these names are unique
|
|
||||||
|
|
||||||
// parse body parses the body of an arf file, after the metadata header.
|
// parse body parses the body of an arf file, after the metadata header.
|
||||||
func (parser *ParsingOperation) parseBody () (err error) {
|
func (parser *ParsingOperation) parseBody () (err error) {
|
||||||
for {
|
for {
|
||||||
|
|||||||
@ -5,13 +5,12 @@ import "git.tebibyte.media/arf/arf/lexer"
|
|||||||
|
|
||||||
// parseData parses a data section.
|
// parseData parses a data section.
|
||||||
func (parser *ParsingOperation) parseDataSection () (
|
func (parser *ParsingOperation) parseDataSection () (
|
||||||
section *DataSection,
|
section DataSection,
|
||||||
err error,
|
err error,
|
||||||
) {
|
) {
|
||||||
err = parser.expect(lexer.TokenKindName)
|
err = parser.expect(lexer.TokenKindName)
|
||||||
if err != nil { return }
|
if err != nil { return }
|
||||||
|
|
||||||
section = &DataSection { }
|
|
||||||
section.location = parser.token.Location()
|
section.location = parser.token.Location()
|
||||||
|
|
||||||
err = parser.nextToken(lexer.TokenKindPermission)
|
err = parser.nextToken(lexer.TokenKindPermission)
|
||||||
|
|||||||
@ -6,13 +6,12 @@ import "git.tebibyte.media/arf/arf/infoerr"
|
|||||||
|
|
||||||
// parseEnumSection parses an enumerated type section.
|
// parseEnumSection parses an enumerated type section.
|
||||||
func (parser *ParsingOperation) parseEnumSection () (
|
func (parser *ParsingOperation) parseEnumSection () (
|
||||||
section *EnumSection,
|
section EnumSection,
|
||||||
err error,
|
err error,
|
||||||
) {
|
) {
|
||||||
err = parser.expect(lexer.TokenKindName)
|
err = parser.expect(lexer.TokenKindName)
|
||||||
if err != nil { return }
|
if err != nil { return }
|
||||||
|
|
||||||
section = &EnumSection { }
|
|
||||||
section.location = parser.token.Location()
|
section.location = parser.token.Location()
|
||||||
|
|
||||||
// get permission
|
// get permission
|
||||||