Update kong
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user