fix: pass arguments to regex constructor in LOAD_REGEX

This commit is contained in:
TopchetoEU 2023-12-27 13:28:17 +02:00
parent 3343262e72
commit 579f09c837
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -199,7 +199,7 @@ public class Runners {
} }
public static Object execLoadRegEx(Context ctx, Instruction instr, CodeFrame frame) { public static Object execLoadRegEx(Context ctx, Instruction instr, CodeFrame frame) {
if (ctx.has(Environment.REGEX_CONSTR)) { if (ctx.has(Environment.REGEX_CONSTR)) {
frame.push(ctx, Values.callNew(ctx, ctx.get(Environment.REGEX_CONSTR))); frame.push(ctx, Values.callNew(ctx, ctx.get(Environment.REGEX_CONSTR), instr.get(0), instr.get(1)));
} }
else { else {
throw EngineException.ofSyntax("Regex is not supported."); throw EngineException.ofSyntax("Regex is not supported.");