Removed dead code

This commit is contained in:
Eduard Urbach 2025-03-04 13:35:55 +01:00
parent 9a018f29e7
commit ada7aaa1e2
Signed by: eduard
GPG key ID: 49226B848C78F6C8
14 changed files with 54 additions and 63 deletions

View file

@ -13,20 +13,35 @@ import (
// All call registers must hold the correct parameter values before the function invocation.
// Registers that are in use must be saved if they are modified by the function.
// After the function call, they must be restored in reverse order.
func (f *Function) CompileCall(root *expression.Expression) ([]types.Type, error) {
func (f *Function) CompileCall(root *expression.Expression) ([]*Parameter, error) {
if root.Children[0].Token.Kind == token.Identifier {
name := root.Children[0].Token.Text(f.File.Bytes)
switch name {
case "len":
return _len.OutputTypes, f.CompileLen(root)
case "syscall":
return nil, f.CompileSyscall(root)
case "len":
output := []*Parameter{{
name: "length",
typ: types.AnyInt,
}}
return output, f.CompileLen(root)
case "new":
typ, err := f.CompileNew(root)
return []types.Type{typ}, err
output := []*Parameter{{
name: "address",
typ: typ,
}}
return output, err
case "delete":
return nil, f.CompileDelete(root)
case "store":
return nil, f.CompileMemoryStore(root)
}
@ -62,7 +77,7 @@ func (f *Function) CompileCall(root *expression.Expression) ([]types.Type, error
f.BeforeCall()
f.Label(asm.CALL, value.Label)
f.AfterCall(registers)
return fn.OutputTypes, nil
return fn.Output, nil
case *eval.Register:
err := f.ExpressionsToRegisters(parameters, registers, nil, true)