fix variable unable to be assigned on the same line

This commit is contained in:
2023-08-06 18:23:35 +01:00
parent fc8916ce4b
commit 035df80758
7 changed files with 108 additions and 105 deletions

View File

@@ -26,3 +26,20 @@ func ArValidToAny(a any) any {
}
return a
}
func ArValidToHash(a any) (any, ArErr) {
switch a := a.(type) {
case ArObject:
if callable, ok := a.obj["__hash__"]; ok {
value, err := runCall(call{
Callable: callable,
Args: []any{},
}, stack{}, 0)
if err.EXISTS {
return nil, err
}
return value, ArErr{}
}
}
return a, ArErr{}
}