From 1fe56dbf17af6cf7d2ea02e2d037da4b9b98561f Mon Sep 17 00:00:00 2001 From: TudbuT Date: Tue, 17 May 2022 20:36:40 +0200 Subject: [PATCH] add acopy native (must be included manually for backwards compatibility, for now) --- ISBPL.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ISBPL.java b/ISBPL.java index 44c68f5..cacb71a 100644 --- a/ISBPL.java +++ b/ISBPL.java @@ -323,6 +323,19 @@ public class ISBPL { stack.push(new ISBPLObject(getType("array"), arr)); }; break; + case "acopy": + func = (stack) -> { + ISBPLObject len = stack.pop(); + ISBPLObject idx2 = stack.pop(); + ISBPLObject idx1 = stack.pop(); + ISBPLObject arr2 = stack.pop(); + ISBPLObject arr1 = stack.pop(); + arr1.checkType(getType("array")); + arr2.checkType(getType("array")); + System.arraycopy((ISBPLObject[]) arr1.object, (int) idx1.toLong(), (ISBPLObject[]) arr2.object, (int) idx2.toLong(), (int) len.toLong()); + stack.push(arr2); + }; + break; case "_array": func = (Stack stack) -> { ISBPLObject a = stack.pop();