Files
Toy/source/toy_attributes.h
T
Ratstail91 0c24a7609e Added the following attributes:
* table.length
* table.insert(key,value)
* table.hasKey(key)
* table.remove(key)

There's basically only iteration and sorting left.
2026-04-24 23:01:57 +10:00

23 lines
670 B
C

#pragma once
#include "toy_value.h"
#include "toy_vm.h"
Toy_Value handleStringAttributes(Toy_VM* vm, Toy_Value compound, Toy_Value attribute);
Toy_Value handleArrayAttributes(Toy_VM* vm, Toy_Value compound, Toy_Value attribute);
Toy_Value handleTableAttributes(Toy_VM* vm, Toy_Value compound, Toy_Value attribute);
// [x] string.length
// [x] string.asUpper
// [x] string.asLower
// [x] array.length
// [x] array.pushBack(x)
// [x] array.popBack()
// [ ] array.forEach(fn) // fn(x) -> void
// [ ] array.sort(fn) // fn(a,b) -> int
// [x] table.length
// [x] table.insert(x, y)
// [x] table.hasKey(x)
// [x] table.remove(x)
// [ ] table.forEach(fn) // fn(x) -> void