aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ast.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ast.c b/src/ast.c
index 0211d91..5f56419 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -175,15 +175,23 @@ static BufferView ast_get_code_reference(Ast *self) {
}
void ast_resolve(Ast *self, AstCompilerContext *context) {
+ /*
+ TODO: Move these to the types that need checks for recursive dependency (function declaration, struct declaration)
+ For function declaration, it should be marked as resolved when the signature has been resolved
+ instead of the whole function declaration including the body
+ because the body can have function call that calls functions that are resolving
+ or even recursive function call, which should be allowed.
+
if(self->resolve_status == AST_RESOLVED) {
return;
} else if(self->resolve_status == AST_RESOLVING) {
tokenizer_get_code_reference_index(&context->parser->tokenizer, ast_get_code_reference(self).data);
tokenizer_print_error(&context->parser->tokenizer,
tokenizer_get_code_reference_index(&context->parser->tokenizer, ast_get_code_reference(self).data),
- "Found recursive declaration");
+ "Found recursive dependency");
throw(AST_ERR);
}
+ */
self->resolve_status = AST_RESOLVING;
switch(self->type) {
@@ -213,5 +221,5 @@ void ast_resolve(Ast *self, AstCompilerContext *context) {
binop_resolve(self->value.binop, context);
break;
}
- self->resolve_status = AST_RESOLVED;
+ /*self->resolve_status = AST_RESOLVED;*/
}