mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Updated compiler
This commit is contained in:
@@ -19,6 +19,9 @@ TARGETS+=../source/ast_node.c
|
||||
#parser
|
||||
TARGETS+=../source/parser.c
|
||||
|
||||
#compiler
|
||||
TARGETS+=../source/compiler.c
|
||||
|
||||
TESTS = $(wildcard test_*.c)
|
||||
OBJ = $(addprefix $(ODIR)/,$(TARGETS:../source/%.c=%.o)) $(addprefix $(ODIR)/,$(TESTS:.c=.o))
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ int main() {
|
||||
|
||||
//cleanup
|
||||
FREE_ARRAY(unsigned char, bytecode, size);
|
||||
freeNode(node);
|
||||
freeASTNode(node);
|
||||
freeParser(&parser);
|
||||
freeCompiler(&compiler);
|
||||
}
|
||||
@@ -97,14 +97,14 @@ int main() {
|
||||
|
||||
ASTNode* node = scanParser(&parser);
|
||||
while (node != NULL) {
|
||||
if (node->type == AST_NODEERROR) {
|
||||
if (node->type == AST_NODE_ERROR) {
|
||||
fprintf(stderr, ERROR "ERROR: Error node found" RESET);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//write
|
||||
writeCompiler(&compiler, node);
|
||||
freeNode(node);
|
||||
freeASTNode(node);
|
||||
|
||||
node = scanParser(&parser);
|
||||
}
|
||||
Reference in New Issue
Block a user