From 43ff02231117bacb3cd60af0e654a0b3e8b5678b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 23 Jan 2020 07:05:01 +0100 Subject: wip... there is a crash in get_or_create hash map --- include/program.h | 7 ++++++- include/value.h | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/program.h b/include/program.h index 6135726..c097c7b 100644 --- a/include/program.h +++ b/include/program.h @@ -3,10 +3,15 @@ #include "std/buffer.h" #include "std/hash_map.h" +#include "value.h" + +#define TSL_STACK_MAX_SIZE 255 typedef struct { TslBuffer /*TslBytecode*/ function_bytecode_list; - TslHashMap variables; + TslHashMap /*TslStringView, TslValue*/ variables; + TslValue stack_values[TSL_STACK_MAX_SIZE]; + size_t stack_index; } TslProgram; typedef enum { diff --git a/include/value.h b/include/value.h index 1d053b7..58e57fe 100644 --- a/include/value.h +++ b/include/value.h @@ -14,6 +14,9 @@ typedef enum { TSL_TYPE_USERDATA } TslType; +/* TODO: Support BigInt */ +typedef double TslNumber; + typedef enum { TSL_FALSE, TSL_TRUE @@ -36,7 +39,7 @@ typedef struct { typedef struct { union { - double number; + TslNumber number; TslString *string; TslBool boolean; TslList *list; -- cgit v1.2.3