From a2274155bce516f904486e7f0ddf20d01093251b Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Wed, 6 Apr 2022 08:20:49 -0300 Subject: Add TODO.md file to keep track of open tasks --- TODO.md | 13 +++++++++++++ src/main.c | 19 ------------------- src/parser.c | 9 +++------ 3 files changed, 16 insertions(+), 25 deletions(-) create mode 100644 TODO.md diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..893ec2f --- /dev/null +++ b/TODO.md @@ -0,0 +1,13 @@ +# Currently open issues + +- [] Fill up symbol tables/environments/types. +- [] Add symbol name checking (first pass should fill symbol names on global + scope so that we can use global functions/variables before they are inside + procedures even when those come first). +- [] Add type checking. +- [] Support output dot files for visualizing internal data structures with + `graphviz` +- [] Use bump allocators to avoid a large number of `malloc` calls. +- [] Free memory. Not important for now, since it will be cleaned up at exit. +- [] Add structs. +- [] Add arrays and darrays. diff --git a/src/main.c b/src/main.c index c545f6a..961905f 100644 --- a/src/main.c +++ b/src/main.c @@ -26,30 +26,11 @@ void process_source(const StringView *source, const char *file_name) { // Read tokens. Token *tokens = tokenize(source); - // print_tokens(tokens); check_errors(file_name); // Parser. parse(tokens); - // print_program(program); check_errors(file_name); - - // if (errors.n != 0) { - // report_errors(&errors, file_name); - // free_objects(); - // array_free(tokens); - // exit(EXIT_FAILURE); - // } - // array_free(tokens); - - // // TODO: Optimization. - - // // Compilation. - // ProgramIr program_ir = compile(program); - // (void)program_ir; - - // // Free resources. - // free_objects(); } void diff --git a/src/parser.c b/src/parser.c index b76e32f..2c1c24f 100644 --- a/src/parser.c +++ b/src/parser.c @@ -198,8 +198,8 @@ parse_def(Parser *parser) { return NULL; } - // TODO: Making type checking mandatory for now until we introduce - // type inference. + // TODO: Making type definitions mandatory for now until we introduce type + // inference. Node *type = parse_type(parser); if (type == NULL) { return NULL; @@ -364,7 +364,6 @@ parse_paren(Parser *parser) { default: break; } - // TODO: Lookup value on symbol table. push_error(ERR_TYPE_PARSER, ERR_UNIMPLEMENTED, tok.line, tok.col); return NULL; } @@ -418,9 +417,7 @@ parse(Token *tokens) { // DEBUG: TOKENS printf("-- tokens --\n"); - for (size_t i = 0; i < array_size(tokens); i++) { - print_token(tokens[i]); - } + print_tokens(parser.tokens); printf("------------\n"); while (has_next(&parser)) { -- cgit v1.2.1