some improvments

This commit is contained in:
Adrian Zürcher
2026-01-01 11:00:23 +01:00
parent 8f313c00f0
commit ef0778c8b3
20 changed files with 305 additions and 385 deletions

View File

@@ -37,24 +37,24 @@ func PSObjectArrayToFloat64Array(objects []PSObject) ([]float64, error) {
return vals, nil
}
func (this *PSExecutor) Execute(objects []PSObject) ([]PSObject, error) {
func (pE *PSExecutor) Execute(objects []PSObject) ([]PSObject, error) {
// Add the arguments on stack
// [obj1 obj2 ...]
for _, obj := range objects {
err := this.Stack.Push(obj)
err := pE.Stack.Push(obj)
if err != nil {
return nil, err
}
}
err := this.program.Exec(this.Stack)
err := pE.program.Exec(pE.Stack)
if err != nil {
common.Log.Debug("Exec failed: %v", err)
return nil, err
}
result := []PSObject(*this.Stack)
this.Stack.Empty()
result := []PSObject(*pE.Stack)
pE.Stack.Empty()
return result, nil
}