mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
'print' now works as expected
String literals are now stored in the bucket mid-compilation, but this is fine, as the buckets are freed one the bytecode is complete.
This commit is contained in:
@@ -63,7 +63,7 @@ static void processRead(Toy_VM* vm) {
|
||||
|
||||
case TOY_VALUE_STRING: {
|
||||
enum Toy_StringType stringType = READ_BYTE(vm);
|
||||
int len = (int)READ_BYTE(vm); //only needed for name strings
|
||||
//int len = (int)READ_BYTE(vm); //WARN: only used for name strings
|
||||
|
||||
//grab the jump as an integer
|
||||
unsigned int jump = *((int*)(vm->code + vm->jumpsAddr + READ_INT(vm)));
|
||||
@@ -73,7 +73,7 @@ static void processRead(Toy_VM* vm) {
|
||||
|
||||
//build a string from the data section
|
||||
if (stringType == TOY_STRING_LEAF) {
|
||||
value = TOY_VALUE_FROM_STRING(Toy_toStringLength(&vm->memoryBucket, cstring, len));
|
||||
value = TOY_VALUE_FROM_STRING(Toy_toString(&vm->memoryBucket, cstring));
|
||||
}
|
||||
else {
|
||||
Toy_error("Invalid string type found in opcode read");
|
||||
|
||||
Reference in New Issue
Block a user