Started work on an AST inspector

This commit is contained in:
2026-04-22 15:57:43 +10:00
parent 63dfd33e5e
commit accb7f9fb4
7 changed files with 166 additions and 5 deletions
+11
View File
@@ -1,3 +1,4 @@
#include "ast_inspector.h"
#include "bytecode_inspector.h"
#include "toy_console_colors.h"
@@ -377,6 +378,11 @@ int repl(const char* filepath, bool verbose) {
printf("%s> ", prompt); //shows the terminal prompt
continue;
}
if (verbose) {
inspect_ast(ast);
}
unsigned char* bytecode = Toy_compileToBytecode(ast);
if (verbose) {
@@ -473,6 +479,11 @@ int main(int argc, const char* argv[]) {
Toy_Bucket* bucket = Toy_allocateBucket(TOY_BUCKET_IDEAL);
Toy_Ast* ast = Toy_scanParser(&bucket, &parser);
if (cmd.verbose) {
inspect_ast(ast);
}
unsigned char* bytecode = Toy_compileToBytecode(ast);
Toy_freeBucket(&bucket);
free(source);