From: Brendan Hansen Date: Wed, 2 Jun 2021 22:13:20 +0000 (-0500) Subject: small bugfixes and documentation X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=b8e1d96ce06059a0966f6029b49d3ddde42d8d9a;p=onyx.git small bugfixes and documentation --- diff --git a/src/onyx.c b/src/onyx.c index 767f2199..0a7b1d50 100644 --- a/src/onyx.c +++ b/src/onyx.c @@ -267,7 +267,7 @@ static b32 process_entity(Entity* ent) { if (context.options->verbose_output == 3) { if (ent->expr && ent->expr->token) snprintf(verbose_output_buffer, 511, - "%15s | %20s (%d, %d) | %s:%i:%i \n", + "%20s | %24s (%d, %d) | %s:%i:%i \n", entity_state_strings[ent->state], entity_type_strings[ent->type], (u32) ent->macro_attempts, @@ -278,7 +278,7 @@ static b32 process_entity(Entity* ent) { else if (ent->expr) snprintf(verbose_output_buffer, 511, - "%15s | %20s (%d, %d) \n", + "%20s | %24s (%d, %d) \n", entity_state_strings[ent->state], entity_type_strings[ent->type], (u32) ent->macro_attempts, @@ -409,6 +409,12 @@ static i32 onyx_compile() { // check if it is the same entity. If it is, it means all other entities that were processed // between the two occurences didn't make any progress either, and there must be a cycle. // - brendanfh 2021/02/06 + // + // Because of the recent changes to the compiler architecture (again), this condition + // does not always hold anymore. There can be nodes that get scheduled multiple times + // before the "key" node that will unblock the progress. This means a more sophisticated + // cycle detection algorithm must be used. + // static Entity* first_no_change = NULL; if (!changed) { if (!first_no_change) first_no_change = ent; diff --git a/src/onyxchecker.c b/src/onyxchecker.c index 49801d8a..28f15d85 100644 --- a/src/onyxchecker.c +++ b/src/onyxchecker.c @@ -1628,7 +1628,9 @@ CheckStatus check_overloaded_function(AstOverloadedFunction* func) { return Check_Error; } - if ((*node)->entity && (*node)->entity->state <= Entity_State_Check_Types) { + if ((*node)->entity && + (*node)->entity->type != Entity_Type_Overloaded_Function && + (*node)->entity->state <= Entity_State_Check_Types) { done = 0; } } diff --git a/src/onyxsymres.c b/src/onyxsymres.c index 4ee4b584..97d4a153 100644 --- a/src/onyxsymres.c +++ b/src/onyxsymres.c @@ -1117,8 +1117,8 @@ void symres_entity(Entity* ent) { } report_unresolved_symbols = (context.entities.type_count[Entity_Type_Static_If] == 0 && - context.entities.type_count[Entity_Type_Use_Package] == 0) - || context.cycle_detected; + context.entities.type_count[Entity_Type_Use_Package] == 0); + // || context.cycle_detected; SymresStatus ss = Symres_Success; EntityState next_state = Entity_State_Check_Types;