mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-05-08 01:31:09 +10:00
Fixed API naming convention
Anything prepended with TOY_API is 'public'. Anything that starts with Toy_private_* shouldn't be touched.
This commit is contained in:
@@ -84,7 +84,7 @@ void inspect_value(Toy_Ast* ast, int depth) {
|
||||
Toy_String* str = Toy_stringifyValue(&bucket, ast->value.value);
|
||||
|
||||
char* buffer = Toy_getStringRaw(str); //SLOW
|
||||
printf("%s '%s'", Toy_private_getValueTypeAsCString(ast->value.value.type), buffer);
|
||||
printf("%s '%s'", Toy_getValueTypeAsCString(ast->value.value.type), buffer);
|
||||
free(buffer);
|
||||
|
||||
Toy_freeString(str);
|
||||
|
||||
@@ -114,7 +114,7 @@ int inspect_bytecode(unsigned char* bytecode) {
|
||||
for (unsigned int i = 0; (i*4) < paramSize; i += 2) {
|
||||
printf(MARKER TOY_CC_NOTICE "%u (type %s, data %u)" TOY_CC_RESET "\n", MARKER_VALUE(param_addr + i, unsigned int),
|
||||
i,
|
||||
Toy_private_getValueTypeAsCString(((unsigned int*)(bytecode + param_addr))[i + 1]),
|
||||
Toy_getValueTypeAsCString(((unsigned int*)(bytecode + param_addr))[i + 1]),
|
||||
((unsigned int*)(bytecode + param_addr))[i] + data_addr
|
||||
);
|
||||
}
|
||||
@@ -162,7 +162,7 @@ int inspect_instruction(unsigned char* bytecode, unsigned int pc, unsigned int j
|
||||
char* cstr = ((char*)(bytecode + data_addr + jumpValue));
|
||||
printf(MARKER "DECLARE %s: %s%s\n", MARKER_VALUE(pc, unsigned char),
|
||||
cstr,
|
||||
Toy_private_getValueTypeAsCString(bytecode[pc + 1]),
|
||||
Toy_getValueTypeAsCString(bytecode[pc + 1]),
|
||||
bytecode[pc + 3] ? " const" : ""
|
||||
);
|
||||
return 8;
|
||||
@@ -182,7 +182,7 @@ int inspect_instruction(unsigned char* bytecode, unsigned int pc, unsigned int j
|
||||
|
||||
case TOY_OPCODE_INVOKE:
|
||||
printf(MARKER "INVOKE as '%s' (%d parameters)\n", MARKER_VALUE(pc, unsigned char),
|
||||
Toy_private_getValueTypeAsCString(bytecode[pc + 1]),
|
||||
Toy_getValueTypeAsCString(bytecode[pc + 1]),
|
||||
bytecode[pc + 2]);
|
||||
return 4;
|
||||
|
||||
@@ -380,7 +380,7 @@ int inspect_read(unsigned char* bytecode, unsigned int pc, unsigned int jumps_ad
|
||||
case TOY_VALUE_ANY:
|
||||
case TOY_VALUE_UNKNOWN:
|
||||
default: {
|
||||
printf(MARKER TOY_CC_WARN "READ %s (unhandled by inspector)" TOY_CC_RESET "\n", MARKER_VALUE(pc, unsigned char), Toy_private_getValueTypeAsCString(type));
|
||||
printf(MARKER TOY_CC_WARN "READ %s (unhandled by inspector)" TOY_CC_RESET "\n", MARKER_VALUE(pc, unsigned char), Toy_getValueTypeAsCString(type));
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -259,7 +259,7 @@ static void debugStackPrint(Toy_Stack* stack) {
|
||||
Toy_Value v = ((Toy_Value*)(stack + 1))[i]; //'stack + 1' is a naughty trick
|
||||
|
||||
//print type
|
||||
printf("%-20s", Toy_private_getValueTypeAsCString(v.type));
|
||||
printf("%-20s", Toy_getValueTypeAsCString(v.type));
|
||||
|
||||
//print value
|
||||
Toy_String* string = Toy_stringifyValue(&stringBucket, Toy_unwrapValue(v));
|
||||
@@ -289,7 +289,7 @@ static void debugScopePrint(Toy_Scope* scope, int depth) {
|
||||
Toy_String k = scope->data[i].key;
|
||||
Toy_Value v = scope->data[i].value;
|
||||
|
||||
printf("%-10s%-10s%-20s", Toy_private_getValueTypeAsCString(scope->data[i].type), scope->data[i].constant ? "const" : "", k.leaf.data);
|
||||
printf("%-10s%-10s%-20s", Toy_getValueTypeAsCString(scope->data[i].type), scope->data[i].constant ? "const" : "", k.leaf.data);
|
||||
|
||||
//print value
|
||||
Toy_String* string = Toy_stringifyValue(&stringBucket, Toy_unwrapValue(v));
|
||||
|
||||
Reference in New Issue
Block a user