Implemented compilation to SSA form
All checks were successful
/ test (push) Successful in 31s

This commit is contained in:
Eduard Urbach 2025-06-23 00:17:05 +02:00
parent f7be86a3d9
commit 31c5ed614c
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
27 changed files with 548 additions and 61 deletions

View file

@ -11,20 +11,26 @@ import (
// Function is the smallest unit of code.
type Function struct {
ssa.Function
Name string
UniqueName string
File *fs.File
Input []*Parameter
Output []*Parameter
Body token.List
Name string
UniqueName string
File *fs.File
Input []*Parameter
Output []*Parameter
Body token.List
Identifiers map[string]*ssa.Value
Err error
}
// NewFunction creates a new function.
func NewFunction(name string, file *fs.File) *Function {
return &Function{
Name: name,
File: file,
UniqueName: fmt.Sprintf("%s.%s", file.Package, name),
Name: name,
File: file,
UniqueName: fmt.Sprintf("%s.%s", file.Package, name),
Identifiers: make(map[string]*ssa.Value),
Function: ssa.Function{
Blocks: []*ssa.Block{{}},
},
}
}