aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-03-09 14:52:16 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit1786b7b98d9841aab03703aa682cd41d27708716 (patch)
treef9961c5488188888472df77d10797df63bce07cf
parenta52fdf470aa2c164108aeccc2c83bad62208913c (diff)
Temporary remove ast resolving
-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;*/
}