Skip to content

Commit 53a5e3d

Browse files
authored
...
1 parent 7dbd1a4 commit 53a5e3d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

vm.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
#ifndef VM_H
22
#define VM_H
33

4-
#include "compiler.h"
4+
#include <stdint.h>
5+
#include "value.h"
6+
#include "chunk.h"
7+
8+
#define STACK_MAX 256
9+
10+
typedef struct {
11+
Chunk* chunk;
12+
uint8_t* ip;
13+
Value stack[STACK_MAX];
14+
Value* stack_top;
15+
} VM;
516

617
typedef enum {
718
INTERPRET_OK,
@@ -15,4 +26,7 @@ InterpretResult interpret(VM* vm, const char* source);
1526
void push(VM* vm, Value value);
1627
Value pop(VM* vm);
1728

29+
bool is_falsey(Value value);
30+
bool values_equal(Value a, Value b);
31+
1832
#endif

0 commit comments

Comments
 (0)