Cleaned up function type

This commit is contained in:
2024-06-29 11:49:32 +02:00
parent 5f2ff5e74e
commit 3e47a12ecd
14 changed files with 310 additions and 294 deletions

18
src/build/Return.go Normal file
View File

@ -0,0 +1,18 @@
package build
import (
"git.akyoto.dev/cli/q/src/build/expression"
"git.akyoto.dev/cli/q/src/build/token"
)
// CompileReturn compiles a return instruction.
func (f *Function) CompileReturn(tokens token.List) error {
if len(tokens) > 1 {
value := expression.Parse(tokens[1:])
defer value.Close()
// TODO: Set the return value
}
f.assembler.Return()
return nil
}