More refactoring trying to get this cleaned up while trying to keep it easy(ish) to extend for later chapters. I'll never take namespaces for granted again...

This commit is contained in:
2022-03-09 21:13:52 +00:00
parent e802c57a93
commit f666585f5f
2 changed files with 114 additions and 19 deletions
+9 -2
View File
@@ -4,8 +4,15 @@
#include "expr.h"
#include "token.h"
typedef enum {
INS_STRING,
INS_DOUBLE,
INS_BOOLEAN,
INS_NULL
} ObjectInstanceType;
typedef struct Object {
TokenType instance;
ObjectInstanceType instance;
union {
char* string;
double number;
@@ -15,6 +22,6 @@ typedef struct Object {
const void* VisitLiteralExpression(Expr*);
void* VisitGroupingExpression(Expr*);
void* VisitBinaryExpression(Expr*);
Object* VisitBinaryExpression(Expr*);
#endif