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:
+9
-2
@@ -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
|
||||
Reference in New Issue
Block a user