Functions are successfully called, read more

Return keyword is not yet implemented.

Functions are untested.

See #163
This commit is contained in:
2025-02-17 14:05:07 +11:00
parent 76d89fe0ad
commit 02dfc996b4
12 changed files with 193 additions and 27 deletions

View File

@@ -311,7 +311,7 @@ bool Toy_checkValuesAreEqual(Toy_Value left, Toy_Value right) {
}
case TOY_VALUE_FUNCTION:
return false; //URGENT: check this
return false; //URGENT: test this
case TOY_VALUE_OPAQUE:
case TOY_VALUE_ANY:
@@ -432,10 +432,10 @@ Toy_String* Toy_stringifyValue(Toy_Bucket** bucketHandle, Toy_Value value) {
switch(value.type) {
case TOY_VALUE_NULL:
return Toy_createString(bucketHandle, "null");
return Toy_createString(bucketHandle, "<null>");
case TOY_VALUE_BOOLEAN:
return Toy_createString(bucketHandle, value.as.boolean ? "true" : "false");
return Toy_createString(bucketHandle, value.as.boolean ? "<true>" : "<false>");
case TOY_VALUE_INTEGER: {
char buffer[16];
@@ -622,7 +622,9 @@ Toy_String* Toy_stringifyValue(Toy_Bucket** bucketHandle, Toy_Value value) {
return string;
}
case TOY_VALUE_FUNCTION: //URGENT: check this
case TOY_VALUE_FUNCTION:
//dummy
return Toy_createString(bucketHandle, "<fn>");
case TOY_VALUE_OPAQUE:
case TOY_VALUE_ANY: