q/src/build/core/Function.go

29 lines
590 B
Go

package core
import (
"git.akyoto.dev/cli/q/src/build/fs"
"git.akyoto.dev/cli/q/src/build/register"
"git.akyoto.dev/cli/q/src/build/token"
)
// Function represents the smallest unit of code.
type Function struct {
register.Machine
Name string
File *fs.File
Body []token.Token
Functions map[string]*Function
Err error
deferred []func()
count counter
}
// counter stores how often a certain statement appeared so we can generate a unique label from it.
type counter struct {
assert int
branch int
data int
loop int
subBranch int
}