All tests passing, repl builds successfully

This commit is contained in:
2022-11-26 09:53:59 +00:00
parent f6367fa89d
commit cfafba589b
8 changed files with 21 additions and 41 deletions

View File

@@ -4,27 +4,7 @@ IDIR +=. ../source ../repl
CFLAGS +=$(addprefix -I,$(IDIR)) -g -Wall -W -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable
LIBS +=
ODIR = obj
#TARGETS = $(wildcard ../source/*.c) $(wildcard ../repl/lib_*.c)
#literal primitives
TARGETS+=../source/memory.c ../source/refstring.c ../source/literal.c ../source/literal_array.c ../source/literal_dictionary.c ../source/scope.c
#lexer
TARGETS+=../source/toy_common.c ../source/keyword_types.c ../source/lexer.c
#ast primitives
TARGETS+=../source/ast_node.c
#parser
TARGETS+=../source/parser.c
#compiler
TARGETS+=../source/compiler.c
#interpreter
TARGETS+=../source/interpreter.c ../source/builtin.c
TARGETS = $(wildcard ../source/*.c) $(wildcard ../repl/lib_*.c)
TESTS = $(wildcard test_*.c)
OBJ = $(addprefix $(ODIR)/,$(TARGETS:../source/%.c=%.o)) $(addprefix $(ODIR)/,$(TESTS:.c=.o))

View File

@@ -64,16 +64,16 @@ unsigned char* compileString(char* source, size_t* size) {
ASTNode* node = scanParser(&parser);
while(node != NULL) {
//pack up and leave
if (node->type == AST_NODEERROR) {
if (node->type == AST_NODE_ERROR) {
printf(ERROR "error node detected\n" RESET);
freeNode(node);
freeASTNode(node);
freeCompiler(&compiler);
freeParser(&parser);
return NULL;
}
writeCompiler(&compiler, node);
freeNode(node);
freeASTNode(node);
node = scanParser(&parser);
}

View File

@@ -79,16 +79,16 @@ unsigned char* compileString(char* source, size_t* size) {
ASTNode* node = scanParser(&parser);
while(node != NULL) {
//pack up and leave
if (node->type == AST_NODEERROR) {
if (node->type == AST_NODE_ERROR) {
printf(ERROR "error node detected\n" RESET);
freeNode(node);
freeASTNode(node);
freeCompiler(&compiler);
freeParser(&parser);
return NULL;
}
writeCompiler(&compiler, node);
freeNode(node);
freeASTNode(node);
node = scanParser(&parser);
}

View File

@@ -62,16 +62,16 @@ unsigned char* compileString(char* source, size_t* size) {
ASTNode* node = scanParser(&parser);
while(node != NULL) {
//pack up and leave
if (node->type == AST_NODEERROR) {
if (node->type == AST_NODE_ERROR) {
printf(ERROR "error node detected\n" RESET);
freeNode(node);
freeASTNode(node);
freeCompiler(&compiler);
freeParser(&parser);
return NULL;
}
writeCompiler(&compiler, node);
freeNode(node);
freeASTNode(node);
node = scanParser(&parser);
}