WIP: Implementing arrays into the script, read more

I had intended to solve the Advent of Code puzzles in Toy, but they
don't work without arrays. I wasn't able to enable arrays in time, so
I need to focus on doing things correctly.

The most immediate tasks are marked with 'URGENT', and a lot of tests
need writing.
This commit is contained in:
2024-12-02 11:58:03 +11:00
parent 12c6ac938c
commit 62ca7a1fb7
16 changed files with 599 additions and 241 deletions

View File

@@ -341,6 +341,8 @@ static void debugStackPrint(Toy_Stack* stack) {
printf("%s\t", Toy_private_getValueTypeAsCString(v.type));
v = Toy_unwrapValue(v);
switch(v.type) {
case TOY_VALUE_NULL:
printf("null");
@@ -382,6 +384,7 @@ static void debugStackPrint(Toy_Stack* stack) {
case TOY_VALUE_OPAQUE:
case TOY_VALUE_TYPE:
case TOY_VALUE_ANY:
case TOY_VALUE_REFERENCE:
case TOY_VALUE_UNKNOWN:
printf("???");
break;
@@ -406,6 +409,9 @@ static void debugScopePrint(Toy_Scope* scope, int depth) {
printf("%s\t%s\t", Toy_private_getValueTypeAsCString(v.type), TOY_VALUE_AS_STRING(k)->as.name.data);
k = Toy_unwrapValue(k);
v = Toy_unwrapValue(v);
switch(v.type) {
case TOY_VALUE_NULL:
printf("null");
@@ -447,6 +453,7 @@ static void debugScopePrint(Toy_Scope* scope, int depth) {
case TOY_VALUE_OPAQUE:
case TOY_VALUE_TYPE:
case TOY_VALUE_ANY:
case TOY_VALUE_REFERENCE:
case TOY_VALUE_UNKNOWN:
printf("???");
break;