Something went wrong. Try again.
🌱 A minimal programming language and compiler. git.urbach.dev/cli/q
high-performance programming-language compiler
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041package core
import ( "git.urbach.dev/cli/q/src/fs" "git.urbach.dev/cli/q/src/token" "git.urbach.dev/cli/q/src/types")
// functionIdentity contains fields that identify the function.type functionIdentity struct { File *fs.File Type *types.Function name string pkg string body token.Source}
// Body returns the function body.func (f *functionIdentity) Body() token.List { return f.File.Tokens[f.body.Start():f.body.End()]}
// IsExtern returns true if the function has no body.func (f *functionIdentity) IsExtern() bool { return f.body.End() == 0}
// Name returns the function name.func (f *functionIdentity) Name() string { return f.name}
// Package returns the package name.func (f *functionIdentity) Package() string { return f.pkg}
// SetBody sets the token range for the function body.func (f *functionIdentity) SetBody(start int, end int) { f.body = token.NewSource(token.Position(start), token.Position(end))}