Implemented type checks

This commit is contained in:
Eduard Urbach 2024-08-07 16:20:03 +02:00
parent baa2463b4b
commit cacee7260a
Signed by: eduard
GPG key ID: 49226B848C78F6C8
19 changed files with 199 additions and 79 deletions

View file

@ -41,7 +41,7 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
}
count := 0
_, err := f.CompileCall(right)
called, err := f.CompileCall(right)
if err != nil {
return err
@ -54,6 +54,10 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
return err
}
if called != nil {
variable.Type = called.ReturnTypes[count]
}
f.RegisterRegister(asm.MOVE, variable.Register, f.CPU.Output[count])
f.AddVariable(variable)
count++