Simplified file structure
This commit is contained in:
35
src/core/Function.go
Normal file
35
src/core/Function.go
Normal file
@ -0,0 +1,35 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"git.akyoto.dev/cli/q/src/fs"
|
||||
"git.akyoto.dev/cli/q/src/register"
|
||||
"git.akyoto.dev/cli/q/src/scope"
|
||||
"git.akyoto.dev/cli/q/src/token"
|
||||
"git.akyoto.dev/cli/q/src/types"
|
||||
)
|
||||
|
||||
// Function represents the smallest unit of code.
|
||||
type Function struct {
|
||||
register.Machine
|
||||
Package string
|
||||
Name string
|
||||
UniqueName string
|
||||
File *fs.File
|
||||
Body token.List
|
||||
Parameters []*scope.Variable
|
||||
ReturnTypes []types.Type
|
||||
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
|
||||
multiBranch int
|
||||
data int
|
||||
loop int
|
||||
subBranch int
|
||||
}
|
Reference in New Issue
Block a user