Skip to content

Commit 6022377

Browse files
committed
feat: Introduce compiler header with parsing rules and implement initial bytecode generation for expressions.
1 parent 50dcf68 commit 6022377

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

include/compiler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typedef struct {
3838
ObjFunction* compile(const char *source);
3939

4040
#include "ast.h"
41-
void generateBytecode(StmtList* statements, Chunk* chunk);
41+
bool generateBytecode(StmtList* statements, Chunk* chunk);
4242

4343
void markCompilerRoots();
4444

src/compiler/bytecode_gen.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ typedef struct Compiler {
4343

4444
typedef struct {
4545
Compiler* compiler;
46-
Chunk* chunk; // Current chunk being written to (convenience)
46+
Chunk* chunk;
47+
bool hadError;
4748
} BytecodeGen;
4849

4950
// --- Forward Declarations ---

0 commit comments

Comments
 (0)