clox/tests/01_main.c

23 lines
451 B
C
Raw Normal View History

2024-08-31 17:41:43 +00:00
#include "../include/common.h"
#include "../include/chunk.h"
#include "../include/debug.h"
2024-09-01 22:43:28 +00:00
#include "../include/vm.h"
2024-08-31 17:41:43 +00:00
int main(void){
2024-09-01 22:43:28 +00:00
initVM();
2024-08-31 17:41:43 +00:00
Chunk chunk;
initChunk(&chunk);
2024-08-31 20:54:46 +00:00
int constant = addConstant(&chunk,1.2);
writeChunk(&chunk, OP_CONSTANT,10);
writeChunk(&chunk,constant,10);
2024-09-01 22:43:28 +00:00
// writeChunk(&chunk, OP_RETURN,10);
2024-08-31 17:41:43 +00:00
disassembleChunk(&chunk,"Test Chunk");
2024-09-01 22:43:28 +00:00
freeVM();
2024-08-31 17:41:43 +00:00
freeChunk(&chunk);
return 0;
}