mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
New method resolution.
This commit is contained in:
committed by
Christoffer Lerno
parent
34b0b6f8f9
commit
4b95d6be4c
@@ -118,6 +118,27 @@ void context_pop_defers(SemaContext *context, AstId *next)
|
||||
context->active_scope.defer_last = defer_start;
|
||||
}
|
||||
|
||||
void sema_add_methods_to_decl_stack(SemaContext *context, Decl *decl)
|
||||
{
|
||||
if (!decl->method_table) return;
|
||||
FOREACH(Decl *, func, decl->method_table->methods)
|
||||
{
|
||||
switch (func->visibility)
|
||||
{
|
||||
case VISIBLE_LOCAL:
|
||||
if (context->unit != func->unit) continue;
|
||||
break;
|
||||
case VISIBLE_PRIVATE:
|
||||
if (context->unit->module != func->unit->module) continue;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
sema_decl_stack_push(func);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void context_pop_defers_and_replace_ast(SemaContext *context, Ast *ast)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user