Trying a more object oriented approach and created an 'Object' struct to have metadata for the values the interpreter works with.

This commit is contained in:
2022-03-08 22:08:06 +00:00
parent 2d587e75b1
commit e802c57a93
4 changed files with 63 additions and 12 deletions
+10
View File
@@ -4,7 +4,17 @@
#include "expr.h"
#include "token.h"
typedef struct Object {
TokenType instance;
union {
char* string;
double number;
int boolean;
} value;
} Object;
const void* VisitLiteralExpression(Expr*);
void* VisitGroupingExpression(Expr*);
void* VisitBinaryExpression(Expr*);
#endif