summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c2
-rw-r--r--src/parser.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 858334b..ee2c381 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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 */