Notify of list deprecation

This commit is contained in:
2026-04-11 09:44:48 +10:00
parent 1939ed019b
commit f5c4468d50

View File

@@ -15,6 +15,8 @@ int currentInstruction = 0;
bool isMainScopeGlobal = true;
bool listDeprecationWarning = true;
char* getFileContents(const char* filename);
[[noreturn]] void customError(GroundArg type, GroundArg what, GroundInstruction* where, int whereLine, int exitCode) {
@@ -963,6 +965,10 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop
break;
}
case SETLIST: {
if (listDeprecationWarning) {
printf("Lists are deprecated, please migrate to using the \"collections\" library soon.\n");
listDeprecationWarning = false;
}
if (in->args.length < 1) {
runtimeError(TOO_FEW_ARGS, "Expecting 1 arg", in, currentInstruction);
}
@@ -980,6 +986,10 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop
break;
}
case SETLISTAT: {
if (listDeprecationWarning) {
printf("Lists are deprecated, please migrate to using the \"collections\" library soon.\n");
listDeprecationWarning = false;
}
if (in->args.length < 3) {
runtimeError(TOO_FEW_ARGS, "Expecting 3 args", in, currentInstruction);
}
@@ -1016,6 +1026,10 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop
break;
}
case GETLISTAT: {
if (listDeprecationWarning) {
printf("Lists are deprecated, please migrate to using the \"collections\" library soon.\n");
listDeprecationWarning = false;
}
if (in->args.length < 2) {
runtimeError(TOO_FEW_ARGS, "Expecting 2 args", in, currentInstruction);
}
@@ -1054,6 +1068,10 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop
break;
}
case GETLISTSIZE: {
if (listDeprecationWarning) {
printf("Lists are deprecated, please migrate to using the \"collections\" library soon.\n");
listDeprecationWarning = false;
}
if (in->args.length < 2) {
runtimeError(TOO_FEW_ARGS, "Expecting 2 args", in, currentInstruction);
}
@@ -1078,6 +1096,10 @@ GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scop
break;
}
case LISTAPPEND: {
if (listDeprecationWarning) {
printf("Lists are deprecated, please migrate to using the \"collections\" library soon.\n");
listDeprecationWarning = false;
}
if (in->args.length < 2) {
runtimeError(TOO_FEW_ARGS, "Expecting 2 args", in, currentInstruction);
}