31 lines
763 B
Go
31 lines
763 B
Go
package parser
|
|
|
|
import "git.tebibyte.media/arf/arf/types"
|
|
import "git.tebibyte.media/arf/arf/lexer"
|
|
// import "git.tebibyte.media/arf/arf/infoerr"
|
|
|
|
// parseFunc parses a function section.
|
|
func (parser *ParsingOperation) parseFuncSection () (
|
|
section *FuncSection,
|
|
err error,
|
|
) {
|
|
err = parser.expect(lexer.TokenKindName)
|
|
if err != nil { return }
|
|
|
|
section = &FuncSection { location: parser.token.Location() }
|
|
|
|
err = parser.nextToken(lexer.TokenKindPermission)
|
|
if err != nil { return }
|
|
section.permission = parser.token.Value().(types.Permission)
|
|
|
|
err = parser.nextToken(lexer.TokenKindName)
|
|
if err != nil { return }
|
|
section.name = parser.token.Value().(string)
|
|
|
|
err = parser.nextToken(lexer.TokenKindNewline)
|
|
if err != nil { return }
|
|
|
|
return
|
|
}
|
|
|