Updated docs and comments

This commit is contained in:
2024-12-11 17:07:49 +11:00
parent 476a79b746
commit 5f4dfdccc5
7 changed files with 74 additions and 32 deletions

View File

@@ -41,5 +41,10 @@ TOY_API Toy_Array* Toy_resizeArray(Toy_Array* array, unsigned int capacity);
#define TOY_ARRAY_PUSHBACK(array, value) (TOY_ARRAY_EXPAND(array), (array)->data[(array)->count++] = (value))
#endif
//URGENT: get array length in scripts (dot operator?)
//URGENT: array as a type
//TODO: array.getLength()
//TODO: array.pushFront(x)
//TODO: array.pushBack(x)
//TODO: array.popFront()
//TODO: array.popBack()
//TODO: array.toString()

View File

@@ -567,7 +567,7 @@ static Toy_AstFlag group(Toy_Bucket** bucketHandle, Toy_Parser* parser, Toy_Ast*
}
static Toy_AstFlag compound(Toy_Bucket** bucketHandle, Toy_Parser* parser, Toy_Ast** rootHandle) {
//read in an array or dictionary compound definition
//read in an array or table compound definition
if (parser->previous.type == TOY_TOKEN_OPERATOR_BRACKET_LEFT) {
//BUGFIX: special case for empty arrays
if (match(parser, TOY_TOKEN_OPERATOR_BRACKET_RIGHT)) {

View File

@@ -3,9 +3,6 @@
#include "toy_print.h"
#include "toy_opcodes.h"
#include "toy_value.h"
#include "toy_string.h"
#include "toy_array.h"
#include <stdio.h>
#include <stdlib.h>

View File

@@ -4,9 +4,14 @@
#include "toy_bytecode.h"
#include "toy_bucket.h"
#include "toy_stack.h"
#include "toy_scope.h"
#include "toy_value.h"
#include "toy_string.h"
#include "toy_stack.h"
#include "toy_array.h"
#include "toy_table.h"
typedef struct Toy_VM {
//raw instructions to be executed
unsigned char* module;