From a51ece60aca15b0c518ca1f02a0f7f2cb37cebf4 Mon Sep 17 00:00:00 2001 From: Vasilii Rogin Date: Thu, 20 Apr 2023 02:51:20 +0300 Subject: [PATCH] Add TODO --- src/sfall_arrays.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sfall_arrays.cc b/src/sfall_arrays.cc index 7350a01..c49eac4 100644 --- a/src/sfall_arrays.cc +++ b/src/sfall_arrays.cc @@ -46,6 +46,7 @@ ArrayId CreateArray(int len, uint32_t flags) if (len < 0) { flags |= SFALL_ARRAYFLAG_ASSOC; + // TODO: Implement throw(std::invalid_argument("Not implemented yet")); }; @@ -87,7 +88,7 @@ ProgramValue GetArrayKey(ArrayId array_id, int index) if (index == -1) { // special index to indicate if array is associative throw(std::invalid_argument("Not implemented yet")); }; - // TODO: if assoc + // TODO: assoc return SFallScriptValue(index); } @@ -97,6 +98,9 @@ int LenArray(ArrayId array_id) if (arr == nullptr) { return -1; }; + + // TODO: assoc + return arr->size(); } @@ -125,6 +129,8 @@ void SetArray(ArrayId array_id, const SFallScriptValue& key, const SFallScriptVa return; }; + // TODO: assoc + if (key.isInt()) { auto index = key.asInt(); if (index >= 0 && index < arr->size()) {