aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2022-04-06 08:20:49 -0300
committerBad Diode <bd@badd10de.dev>2022-04-06 08:20:49 -0300
commita2274155bce516f904486e7f0ddf20d01093251b (patch)
tree3a97dc20cc48d93ae0d529f686af80577912720e /src
parent11df0f4556f526189234be216fa16a2fcb8c308b (diff)
downloadbdl-a2274155bce516f904486e7f0ddf20d01093251b.tar.gz
bdl-a2274155bce516f904486e7f0ddf20d01093251b.zip
Add TODO.md file to keep track of open tasks
Diffstat (limited to 'src')
-rw-r--r--src/main.c19
-rw-r--r--src/parser.c9
2 files changed, 3 insertions, 25 deletions
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
26process_source(const StringView *source, const char *file_name) { 26process_source(const StringView *source, const char *file_name) {
27 // Read tokens. 27 // Read tokens.
28 Token *tokens = tokenize(source); 28 Token *tokens = tokenize(source);
29 // print_tokens(tokens);
30 check_errors(file_name); 29 check_errors(file_name);
31 30
32 // Parser. 31 // Parser.
33 parse(tokens); 32 parse(tokens);
34 // print_program(program);
35 check_errors(file_name); 33 check_errors(file_name);
36
37 // if (errors.n != 0) {
38 // report_errors(&errors, file_name);
39 // free_objects();
40 // array_free(tokens);
41 // exit(EXIT_FAILURE);
42 // }
43 // array_free(tokens);
44
45 // // TODO: Optimization.
46
47 // // Compilation.
48 // ProgramIr program_ir = compile(program);
49 // (void)program_ir;
50
51 // // Free resources.
52 // free_objects();
53} 34}
54 35
55void 36void
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) {
198 return NULL; 198 return NULL;
199 } 199 }
200 200
201 // TODO: Making type checking mandatory for now until we introduce 201 // TODO: Making type definitions mandatory for now until we introduce type
202 // type inference. 202 // inference.
203 Node *type = parse_type(parser); 203 Node *type = parse_type(parser);
204 if (type == NULL) { 204 if (type == NULL) {
205 return NULL; 205 return NULL;
@@ -364,7 +364,6 @@ parse_paren(Parser *parser) {
364 default: break; 364 default: break;
365 } 365 }
366 366
367 // TODO: Lookup value on symbol table.
368 push_error(ERR_TYPE_PARSER, ERR_UNIMPLEMENTED, tok.line, tok.col); 367 push_error(ERR_TYPE_PARSER, ERR_UNIMPLEMENTED, tok.line, tok.col);
369 return NULL; 368 return NULL;
370} 369}
@@ -418,9 +417,7 @@ parse(Token *tokens) {
418 417
419 // DEBUG: TOKENS 418 // DEBUG: TOKENS
420 printf("-- tokens --\n"); 419 printf("-- tokens --\n");
421 for (size_t i = 0; i < array_size(tokens); i++) { 420 print_tokens(parser.tokens);
422 print_token(tokens[i]);
423 }
424 printf("------------\n"); 421 printf("------------\n");
425 422
426 while (has_next(&parser)) { 423 while (has_next(&parser)) {