Tweaked README.md, and some comments

I have an idea for the data structures...
This commit is contained in:
2024-10-01 15:56:40 +10:00
parent a9759384cd
commit 53b0fc158c
2 changed files with 25 additions and 28 deletions

View File

@@ -15,20 +15,20 @@ typedef enum Toy_ValueType {
} Toy_ValueType;
//8 bytes in size
typedef struct Toy_Value {
typedef struct Toy_Value { //32 | 64 BITNESS
union {
bool boolean; //1
int integer; //4
float number; //4
bool boolean; //1 | 1
int integer; //4 | 4
float number; //4 | 4
//TODO: strings
//TODO: arrays
//TODO: dictonaries
//TODO: functions
//TODO: opaque
} as; //4
} as; //4 | 4
Toy_ValueType type; //4
} Toy_Value; //8
Toy_ValueType type; //4 | 4
} Toy_Value; //8 | 8
#define TOY_VALUE_IS_NULL(value) ((value).type == TOY_VALUE_NULL)
#define TOY_VALUE_IS_BOOLEAN(value) ((value).type == TOY_VALUE_BOOLEAN)