Update kong

This commit is contained in:
luboslenco
2025-07-22 17:35:45 +02:00
parent 0f0b367468
commit 52cac00f3d
4 changed files with 32 additions and 4 deletions
+5 -1
View File
@@ -7,7 +7,11 @@
#include <string.h>
static function *functions = NULL;
static function_id functions_size = 1024;
////
// static function_id functions_size = 1024;
static function_id functions_size = 128;
////
////
// static function_id next_function_index = 0;
function_id next_function_index = 0;
+4 -1
View File
@@ -13,7 +13,10 @@ static size_t names_size = 1024 * 1024;
name_id names_index = 1;
////
static struct {
////
// static struct {
struct {
////
char *key;
name_id value;
} *hash = NULL;
+20 -2
View File
@@ -9,8 +9,17 @@
#include <stdlib.h>
#include <string.h>
////
static statement statements_buffer[2048];
int statement_index = 0;
////
static statement *statement_allocate(void) {
statement *s = (statement *)malloc(sizeof(statement));
////
// statement *s = (statement *)malloc(sizeof(statement));
statement *s = &statements_buffer[statement_index];
statement_index++;
////
debug_context context = {0};
check(s != NULL, context, "Could not allocate statement");
return s;
@@ -29,8 +38,17 @@ static void statements_add(statements *statements, statement *statement) {
statements->size += 1;
}
////
static expression experessions_buffer[2048];
int expression_index = 0;
////
static expression *expression_allocate(void) {
expression *e = (expression *)malloc(sizeof(expression));
////
//expression *e = (expression *)malloc(sizeof(expression));
expression *e = &experessions_buffer[expression_index];
expression_index++;
////
debug_context context = {0};
check(e != NULL, context, "Could not allocate expression");
init_type_ref(&e->type, NO_NAME);
+3
View File
@@ -244,6 +244,9 @@ tokens tokenize(const char *filename, const char *source) {
}
tokens_add(&tokens, token_create(TOKEN_NONE, &state));
////
free(buffer.buf);
////
return tokens;
}
else {