Prefix '++' working (postfix is next)

This commit is contained in:
2025-01-09 16:45:48 +11:00
parent 3aee2ba664
commit 6f16c31f24
7 changed files with 102 additions and 79 deletions

View File

@@ -307,7 +307,7 @@ static void processAccess(Toy_VM* vm) {
Toy_Value name = Toy_popStack(&vm->stack);
//check name string type
if (!TOY_VALUE_IS_STRING(name) && TOY_VALUE_AS_STRING(name)->info.type != TOY_STRING_NAME) {
if (!TOY_VALUE_IS_STRING(name) || TOY_VALUE_AS_STRING(name)->info.type != TOY_STRING_NAME) {
Toy_pushStack(&vm->stack, TOY_VALUE_FROM_NULL());
Toy_error("Invalid access target");
return;