diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/parser.c | 3 |
2 files changed, 4 insertions, 1 deletions
@@ -134,6 +134,7 @@ int main(int argc, char **argv) { } else if (strcmp(argv[1], "-r") == 0 || strcmp(argv[1], "--repl") == 0) { printf("Welcome to the NoExcess REPL.\n"); while (true) { + /* TODO: Finish REPL */ } } @@ -165,7 +166,6 @@ int main(int argc, char **argv) { parser_t *parser = init_parser(lexer); visitor_t *visitor = init_visitor(parser); ast_t *root = eval(visitor); - /* print_root(root); */ ast_free(root); ast_free(visitor->root); visitor_free(visitor); diff --git a/src/parser.c b/src/parser.c index 5f97ef9..12b1256 100644 --- a/src/parser.c +++ b/src/parser.c @@ -140,6 +140,9 @@ void parse_bind(parser_t *parser) { parser_error(parser); token_t *t = parser->tokens[parser->i]; char *name = t->value; + if (hash_table_get(parser->symbol_table, name) != NULL) { + parser_error(parser); + } parser_move(parser); ast_t *expr = parse_expr(parser); /* unevaluated expr will be evaluated when hash table transfers to visitor JIT */ |