Implemented Value interface

This commit is contained in:
2025-02-28 12:15:19 +01:00
parent 31423ccc08
commit b67361c035
36 changed files with 194 additions and 153 deletions

View File

@ -11,16 +11,15 @@ func (f *Function) EvaluateCall(expr *expression.Expression) (eval.Value, error)
types, err := f.CompileCall(expr)
if err != nil {
return eval.Value{}, err
return nil, err
}
if len(types) == 0 {
return eval.Value{}, errors.New(errors.UntypedExpression, f.File, expr.Token.Position)
return nil, errors.New(errors.UntypedExpression, f.File, expr.Token.Position)
}
value := eval.Value{
Kind: eval.Register,
Type: types[0],
value := eval.Register{
Typ: types[0],
Register: f.CPU.Output[0],
}