X-Git-Url: http://nitlanguage.org diff --git a/c_src/more_collections.sep.1.c b/c_src/more_collections.sep.1.c index c0cf46f..33baa10 100644 --- a/c_src/more_collections.sep.1.c +++ b/c_src/more_collections.sep.1.c @@ -1,5 +1,5 @@ #include "more_collections.sep.0.h" -/* method more_collections#MultiHashMap#add_one for (self: MultiHashMap[nullable Object, nullable Object], nullable Object, nullable Object) */ +/* method more_collections$MultiHashMap$add_one for (self: MultiHashMap[nullable Object, nullable Object], nullable Object, nullable Object) */ void more_collections___more_collections__MultiHashMap___add_one(val* self, val* p0, val* p1) { short int var /* : Bool */; int cltype; @@ -69,7 +69,7 @@ fatal_exit(1); var_k = p0; var_v = p1; { -var7 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(self, var_k); +var7 = core___core__HashMap___core__abstract_collection__MapRead__get_or_null(self, var_k); } var_x = var7; if (var_x == NULL) { @@ -78,10 +78,10 @@ var8 = 0; /* is null */ var8 = 1; /* arg is null and recv is not */ } if (0) { -{ /* Inline kernel#Object#!= (var_x,((val*)NULL)) on */ +{ /* Inline kernel$Object$!= (var_x,((val*)NULL)) on */ var_other = ((val*)NULL); { -var11 = ((short int(*)(val* self, val* p0))(var_x->class->vft[COLOR_standard__kernel__Object___61d_61d]))(var_x, var_other); /* == on */ +var11 = ((short int(*)(val* self, val* p0))(var_x->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_x, var_other); /* == on */ } var12 = !var11; var9 = var12; @@ -92,25 +92,25 @@ var8 = var9; } if (var8){ { -standard___standard__Array___standard__abstract_collection__SimpleCollection__add(var_x, var_v); /* Direct call array#Array#add on */ +core___core__Array___core__abstract_collection__SimpleCollection__add(var_x, var_v); /* Direct call array$Array$add on */ } } else { -var13 = NEW_standard__Array(self->type->resolution_table->types[COLOR_standard__Array__more_collections__MultiHashMap___35dV]); +var13 = NEW_core__Array(self->type->resolution_table->types[COLOR_core__Array__more_collections__MultiHashMap___35dV]); { -standard___standard__Array___with_capacity(var13, 1l); /* Direct call array#Array#with_capacity on */ +core___core__Array___with_capacity(var13, 1l); /* Direct call array$Array$with_capacity on */ } var_ = var13; { -standard___standard__AbstractArray___standard__abstract_collection__Sequence__push(var_, var_v); /* Direct call array#AbstractArray#push on */ +core___core__AbstractArray___core__abstract_collection__Sequence__push(var_, var_v); /* Direct call array$AbstractArray$push on */ } { -standard___standard__HashMap___standard__abstract_collection__Map___91d_93d_61d(self, var_k, var_); /* Direct call hash_collection#HashMap#[]= on */ +core___core__HashMap___core__abstract_collection__Map___91d_93d_61d(self, var_k, var_); /* Direct call hash_collection$HashMap$[]= on */ } } RET_LABEL:; } -/* method more_collections#MultiHashMap#provide_default_value for (self: MultiHashMap[nullable Object, nullable Object], nullable Object): Array[nullable Object] */ -val* more_collections___more_collections__MultiHashMap___standard__abstract_collection__MapRead__provide_default_value(val* self, val* p0) { +/* method more_collections$MultiHashMap$provide_default_value for (self: MultiHashMap[nullable Object, nullable Object], nullable Object): Array[nullable Object] */ +val* more_collections___more_collections__MultiHashMap___core__abstract_collection__MapRead__provide_default_value(val* self, val* p0) { val* var /* : Array[nullable Object] */; val* var_key /* var key: nullable Object */; val* var1 /* : Array[nullable Object] */; @@ -122,9 +122,9 @@ const struct type* type_struct; short int is_nullable; const char* var_class_name; var_key = p0; -var1 = NEW_standard__Array(self->type->resolution_table->types[COLOR_standard__Array__more_collections__MultiHashMap___35dV]); +var1 = NEW_core__Array(self->type->resolution_table->types[COLOR_core__Array__more_collections__MultiHashMap___35dV]); { -standard___standard__Array___standard__kernel__Object__init(var1); /* Direct call array#Array#init on */ +core___core__Array___core__kernel__Object__init(var1); /* Direct call array$Array$init on */ } var_res = var1; /* isa K */ @@ -148,19 +148,22 @@ PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 51); fatal_exit(1); } { -standard___standard__HashMap___standard__abstract_collection__Map___91d_93d_61d(self, var_key, var_res); /* Direct call hash_collection#HashMap#[]= on */ +core___core__HashMap___core__abstract_collection__Map___91d_93d_61d(self, var_key, var_res); /* Direct call hash_collection$HashMap$[]= on */ } var = var_res; goto RET_LABEL; RET_LABEL:; return var; } -/* method more_collections#HashMap2#level1 for (self: HashMap2[nullable Object, nullable Object, nullable Object]): HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */ +/* method more_collections$HashMap2$level1 for (self: HashMap2[nullable Object, nullable Object, nullable Object]): HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */ val* more_collections___more_collections__HashMap2___level1(val* self) { val* var /* : HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */; val* var1 /* : HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */; var1 = self->attrs[COLOR_more_collections__HashMap2___level1].val; /* _level1 on */ if (unlikely(var1 == NULL)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1"); PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 67); fatal_exit(1); @@ -169,7 +172,7 @@ var = var1; RET_LABEL:; return var; } -/* method more_collections#HashMap2#[] for (self: HashMap2[nullable Object, nullable Object, nullable Object], nullable Object, nullable Object): nullable Object */ +/* method more_collections$HashMap2$[] for (self: HashMap2[nullable Object, nullable Object, nullable Object], nullable Object, nullable Object): nullable Object */ val* more_collections___more_collections__HashMap2____91d_93d(val* self, val* p0, val* p1) { val* var /* : nullable Object */; short int var1 /* : Bool */; @@ -239,9 +242,12 @@ fatal_exit(1); var_k1 = p0; var_k2 = p1; { -{ /* Inline more_collections#HashMap2#level1 (self) on */ +{ /* Inline more_collections$HashMap2$level1 (self) on */ var10 = self->attrs[COLOR_more_collections__HashMap2___level1].val; /* _level1 on */ if (unlikely(var10 == NULL)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1"); PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 67); fatal_exit(1); @@ -252,7 +258,7 @@ RET_LABEL9:(void)0; } var_level1 = var8; { -var11 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(var_level1, var_k1); +var11 = core___core__HashMap___core__abstract_collection__MapRead__get_or_null(var_level1, var_k1); } var_level2 = var11; if (var_level2 == NULL) { @@ -261,7 +267,7 @@ var12 = 1; /* is null */ var12 = 0; /* arg is null but recv is not */ } if (0) { -var13 = standard___standard__MapRead___standard__kernel__Object___61d_61d(var_level2, ((val*)NULL)); +var13 = core___core__MapRead___core__kernel__Object___61d_61d(var_level2, ((val*)NULL)); var12 = var13; } if (var12){ @@ -270,14 +276,14 @@ goto RET_LABEL; } else { } { -var14 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(var_level2, var_k2); +var14 = core___core__HashMap___core__abstract_collection__MapRead__get_or_null(var_level2, var_k2); } var = var14; goto RET_LABEL; RET_LABEL:; return var; } -/* method more_collections#HashMap2#[]= for (self: HashMap2[nullable Object, nullable Object, nullable Object], nullable Object, nullable Object, nullable Object) */ +/* method more_collections$HashMap2$[]= for (self: HashMap2[nullable Object, nullable Object, nullable Object], nullable Object, nullable Object, nullable Object) */ void more_collections___more_collections__HashMap2____91d_93d_61d(val* self, val* p0, val* p1, val* p2) { short int var /* : Bool */; int cltype; @@ -375,9 +381,12 @@ var_k1 = p0; var_k2 = p1; var_v = p2; { -{ /* Inline more_collections#HashMap2#level1 (self) on */ +{ /* Inline more_collections$HashMap2$level1 (self) on */ var15 = self->attrs[COLOR_more_collections__HashMap2___level1].val; /* _level1 on */ if (unlikely(var15 == NULL)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1"); PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 67); fatal_exit(1); @@ -388,7 +397,7 @@ RET_LABEL14:(void)0; } var_level1 = var13; { -var16 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(var_level1, var_k1); +var16 = core___core__HashMap___core__abstract_collection__MapRead__get_or_null(var_level1, var_k1); } var_level2 = var16; if (var_level2 == NULL) { @@ -397,40 +406,43 @@ var17 = 1; /* is null */ var17 = 0; /* arg is null but recv is not */ } if (0) { -var18 = standard___standard__MapRead___standard__kernel__Object___61d_61d(var_level2, ((val*)NULL)); +var18 = core___core__MapRead___core__kernel__Object___61d_61d(var_level2, ((val*)NULL)); var17 = var18; } if (var17){ -var19 = NEW_standard__HashMap(self->type->resolution_table->types[COLOR_standard__HashMap__more_collections__HashMap2___35dK2__more_collections__HashMap2___35dV]); +var19 = NEW_core__HashMap(self->type->resolution_table->types[COLOR_core__HashMap__more_collections__HashMap2___35dK2__more_collections__HashMap2___35dV]); { -standard___standard__HashMap___standard__kernel__Object__init(var19); /* Direct call hash_collection#HashMap#init on */ +core___core__HashMap___core__kernel__Object__init(var19); /* Direct call hash_collection$HashMap$init on */ } var_level2 = var19; { -standard___standard__HashMap___standard__abstract_collection__Map___91d_93d_61d(var_level1, var_k1, var_level2); /* Direct call hash_collection#HashMap#[]= on */ +core___core__HashMap___core__abstract_collection__Map___91d_93d_61d(var_level1, var_k1, var_level2); /* Direct call hash_collection$HashMap$[]= on */ } } else { } { -standard___standard__HashMap___standard__abstract_collection__Map___91d_93d_61d(var_level2, var_k2, var_v); /* Direct call hash_collection#HashMap#[]= on */ +core___core__HashMap___core__abstract_collection__Map___91d_93d_61d(var_level2, var_k2, var_v); /* Direct call hash_collection$HashMap$[]= on */ } RET_LABEL:; } -/* method more_collections#HashMap3#level1 for (self: HashMap3[nullable Object, nullable Object, nullable Object, nullable Object]): HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */ +/* method more_collections$HashMap3$level1 for (self: HashMap3[nullable Object, nullable Object, nullable Object, nullable Object]): HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */ val* more_collections___more_collections__HashMap3___level1(val* self) { val* var /* : HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */; val* var1 /* : HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */; var1 = self->attrs[COLOR_more_collections__HashMap3___level1].val; /* _level1 on */ if (unlikely(var1 == NULL)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1"); -PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 115); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 122); fatal_exit(1); } var = var1; RET_LABEL:; return var; } -/* method more_collections#HashMap3#[] for (self: HashMap3[nullable Object, nullable Object, nullable Object, nullable Object], nullable Object, nullable Object, nullable Object): nullable Object */ +/* method more_collections$HashMap3$[] for (self: HashMap3[nullable Object, nullable Object, nullable Object, nullable Object], nullable Object, nullable Object, nullable Object): nullable Object */ val* more_collections___more_collections__HashMap3____91d_93d(val* self, val* p0, val* p1, val* p2) { val* var /* : nullable Object */; short int var1 /* : Bool */; @@ -483,7 +495,7 @@ var1 = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == id if (unlikely(!var1)) { var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K1", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 117); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 124); fatal_exit(1); } /* Covariant cast for argument 1 (k2) isa K2 */ @@ -504,7 +516,7 @@ var2 = (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->type_table[cltype3] == i if (unlikely(!var2)) { var_class_name7 = p1 == NULL ? "null" : (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K2", var_class_name7); -PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 117); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 124); fatal_exit(1); } /* Covariant cast for argument 2 (k3) isa K3 */ @@ -525,18 +537,21 @@ var8 = (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->type_table[cltype9] == i if (unlikely(!var8)) { var_class_name13 = p2 == NULL ? "null" : (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K3", var_class_name13); -PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 117); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 124); fatal_exit(1); } var_k1 = p0; var_k2 = p1; var_k3 = p2; { -{ /* Inline more_collections#HashMap3#level1 (self) on */ +{ /* Inline more_collections$HashMap3$level1 (self) on */ var16 = self->attrs[COLOR_more_collections__HashMap3___level1].val; /* _level1 on */ if (unlikely(var16 == NULL)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1"); -PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 115); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 122); fatal_exit(1); } var14 = var16; @@ -545,7 +560,7 @@ RET_LABEL15:(void)0; } var_level1 = var14; { -var17 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(var_level1, var_k1); +var17 = core___core__HashMap___core__abstract_collection__MapRead__get_or_null(var_level1, var_k1); } var_level2 = var17; if (var_level2 == NULL) { @@ -554,10 +569,10 @@ var18 = 1; /* is null */ var18 = 0; /* arg is null but recv is not */ } if (0) { -{ /* Inline kernel#Object#== (var_level2,((val*)NULL)) on */ +{ /* Inline kernel$Object$== (var_level2,((val*)NULL)) on */ var_other = ((val*)NULL); { -{ /* Inline kernel#Object#is_same_instance (var_level2,var_other) on */ +{ /* Inline kernel$Object$is_same_instance (var_level2,var_other) on */ var23 = var_level2 == var_other; var21 = var23; goto RET_LABEL22; @@ -583,7 +598,7 @@ goto RET_LABEL; RET_LABEL:; return var; } -/* method more_collections#HashMap3#[]= for (self: HashMap3[nullable Object, nullable Object, nullable Object, nullable Object], nullable Object, nullable Object, nullable Object, nullable Object) */ +/* method more_collections$HashMap3$[]= for (self: HashMap3[nullable Object, nullable Object, nullable Object, nullable Object], nullable Object, nullable Object, nullable Object, nullable Object) */ void more_collections___more_collections__HashMap3____91d_93d_61d(val* self, val* p0, val* p1, val* p2, val* p3) { short int var /* : Bool */; int cltype; @@ -642,7 +657,7 @@ var = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == idt if (unlikely(!var)) { var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K1", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 127); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 134); fatal_exit(1); } /* Covariant cast for argument 1 (k2) isa K2 */ @@ -663,7 +678,7 @@ var1 = (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->type_table[cltype2] == i if (unlikely(!var1)) { var_class_name6 = p1 == NULL ? "null" : (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K2", var_class_name6); -PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 127); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 134); fatal_exit(1); } /* Covariant cast for argument 2 (k3) isa K3 */ @@ -684,7 +699,7 @@ var7 = (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->type_table[cltype8] == i if (unlikely(!var7)) { var_class_name12 = p2 == NULL ? "null" : (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K3", var_class_name12); -PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 127); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 134); fatal_exit(1); } /* Covariant cast for argument 3 (v) isa V */ @@ -705,7 +720,7 @@ var13 = (((long)p3&3)?type_info[((long)p3&3)]:p3->type)->type_table[cltype14] == if (unlikely(!var13)) { var_class_name18 = p3 == NULL ? "null" : (((long)p3&3)?type_info[((long)p3&3)]:p3->type)->name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "V", var_class_name18); -PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 127); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 134); fatal_exit(1); } var_k1 = p0; @@ -713,11 +728,14 @@ var_k2 = p1; var_k3 = p2; var_v = p3; { -{ /* Inline more_collections#HashMap3#level1 (self) on */ +{ /* Inline more_collections$HashMap3$level1 (self) on */ var21 = self->attrs[COLOR_more_collections__HashMap3___level1].val; /* _level1 on */ if (unlikely(var21 == NULL)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1"); -PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 115); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 122); fatal_exit(1); } var19 = var21; @@ -726,7 +744,7 @@ RET_LABEL20:(void)0; } var_level1 = var19; { -var22 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(var_level1, var_k1); +var22 = core___core__HashMap___core__abstract_collection__MapRead__get_or_null(var_level1, var_k1); } var_level2 = var22; if (var_level2 == NULL) { @@ -735,10 +753,10 @@ var23 = 1; /* is null */ var23 = 0; /* arg is null but recv is not */ } if (0) { -{ /* Inline kernel#Object#== (var_level2,((val*)NULL)) on */ +{ /* Inline kernel$Object$== (var_level2,((val*)NULL)) on */ var_other = ((val*)NULL); { -{ /* Inline kernel#Object#is_same_instance (var_level2,var_other) on */ +{ /* Inline kernel$Object$is_same_instance (var_level2,var_other) on */ var28 = var_level2 == var_other; var26 = var28; goto RET_LABEL27; @@ -754,18 +772,213 @@ var23 = var24; if (var23){ var29 = NEW_more_collections__HashMap2(self->type->resolution_table->types[COLOR_more_collections__HashMap2__more_collections__HashMap3___35dK2__more_collections__HashMap3___35dK3__more_collections__HashMap3___35dV]); { -{ /* Inline kernel#Object#init (var29) on */ +{ /* Inline kernel$Object$init (var29) on */ RET_LABEL30:(void)0; } } var_level2 = var29; { -standard___standard__HashMap___standard__abstract_collection__Map___91d_93d_61d(var_level1, var_k1, var_level2); /* Direct call hash_collection#HashMap#[]= on */ +core___core__HashMap___core__abstract_collection__Map___91d_93d_61d(var_level1, var_k1, var_level2); /* Direct call hash_collection$HashMap$[]= on */ } } else { } { -more_collections___more_collections__HashMap2____91d_93d_61d(var_level2, var_k2, var_k3, var_v); /* Direct call more_collections#HashMap2#[]= on */ +more_collections___more_collections__HashMap2____91d_93d_61d(var_level2, var_k2, var_k3, var_v); /* Direct call more_collections$HashMap2$[]= on */ +} +RET_LABEL:; +} +/* method more_collections$BestDistance$best_distance for (self: BestDistance[nullable Object]): Int */ +long more_collections___more_collections__BestDistance___best_distance(val* self) { +long var /* : Int */; +long var1 /* : Int */; +var1 = self->attrs[COLOR_more_collections__BestDistance___best_distance].l; /* _best_distance on */ +var = var1; +RET_LABEL:; +return var; +} +/* method more_collections$BestDistance$best_distance= for (self: BestDistance[nullable Object], Int) */ +void more_collections___more_collections__BestDistance___best_distance_61d(val* self, long p0) { +self->attrs[COLOR_more_collections__BestDistance___best_distance].l = p0; /* _best_distance on */ +RET_LABEL:; +} +/* method more_collections$BestDistance$best_items for (self: BestDistance[nullable Object]): Set[nullable Object] */ +val* more_collections___more_collections__BestDistance___best_items(val* self) { +val* var /* : Set[nullable Object] */; +val* var1 /* : Set[nullable Object] */; +var1 = self->attrs[COLOR_more_collections__BestDistance___best_items].val; /* _best_items on */ +if (unlikely(var1 == NULL)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} +PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _best_items"); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 562); +fatal_exit(1); +} +var = var1; +RET_LABEL:; +return var; +} +/* method more_collections$BestDistance$update for (self: BestDistance[nullable Object], Int, nullable Object): Bool */ +short int more_collections___more_collections__BestDistance___update(val* self, long p0, val* p1) { +short int var /* : Bool */; +short int var1 /* : Bool */; +int cltype; +int idtype; +const struct type* type_struct; +short int is_nullable; +const char* var_class_name; +long var_distance /* var distance: Int */; +val* var_candidate /* var candidate: nullable Object */; +long var2 /* : Int */; +long var4 /* : Int */; +short int var5 /* : Bool */; +short int var7 /* : Bool */; +int cltype8; +int idtype9; +const char* var_class_name10; +short int var11 /* : Bool */; +long var12 /* : Int */; +long var14 /* : Int */; +short int var15 /* : Bool */; +short int var17 /* : Bool */; +int cltype18; +int idtype19; +const char* var_class_name20; +short int var21 /* : Bool */; +val* var23 /* : Set[nullable Object] */; +val* var25 /* : Set[nullable Object] */; +val* var26 /* : Set[nullable Object] */; +val* var28 /* : Set[nullable Object] */; +/* Covariant cast for argument 1 (candidate) isa E */ +/* isa E */ +type_struct = self->type->resolution_table->types[COLOR_more_collections__BestDistance___35dE]; +cltype = type_struct->color; +idtype = type_struct->id; +is_nullable = type_struct->is_nullable; +if(p1 == NULL) { +var1 = is_nullable; +} else { +if(cltype >= (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->table_size) { +var1 = 0; +} else { +var1 = (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->type_table[cltype] == idtype; +} +} +if (unlikely(!var1)) { +var_class_name = p1 == NULL ? "null" : (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "E", var_class_name); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 565); +fatal_exit(1); +} +var_distance = p0; +var_candidate = p1; +{ +{ /* Inline more_collections$BestDistance$best_distance (self) on */ +var4 = self->attrs[COLOR_more_collections__BestDistance___best_distance].l; /* _best_distance on */ +var2 = var4; +RET_LABEL3:(void)0; +} +} +{ +{ /* Inline kernel$Int$> (var_distance,var2) on */ +/* Covariant cast for argument 0 (i) isa OTHER */ +/* isa OTHER */ +var7 = 1; /* easy isa OTHER*/ +if (unlikely(!var7)) { +var_class_name10 = type_core__Int.name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name10); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 727); +fatal_exit(1); +} +var11 = var_distance > var2; +var5 = var11; +goto RET_LABEL6; +RET_LABEL6:(void)0; +} +} +if (var5){ +var = 0; +goto RET_LABEL; +} else { +} +{ +{ /* Inline more_collections$BestDistance$best_distance (self) on */ +var14 = self->attrs[COLOR_more_collections__BestDistance___best_distance].l; /* _best_distance on */ +var12 = var14; +RET_LABEL13:(void)0; +} +} +{ +{ /* Inline kernel$Int$< (var_distance,var12) on */ +/* Covariant cast for argument 0 (i) isa OTHER */ +/* isa OTHER */ +var17 = 1; /* easy isa OTHER*/ +if (unlikely(!var17)) { +var_class_name20 = type_core__Int.name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name20); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 725); +fatal_exit(1); +} +var21 = var_distance < var12; +var15 = var21; +goto RET_LABEL16; +RET_LABEL16:(void)0; +} +} +if (var15){ +{ +{ /* Inline more_collections$BestDistance$best_distance= (self,var_distance) on */ +self->attrs[COLOR_more_collections__BestDistance___best_distance].l = var_distance; /* _best_distance on */ +RET_LABEL22:(void)0; +} +} +{ +{ /* Inline more_collections$BestDistance$best_items (self) on */ +var25 = self->attrs[COLOR_more_collections__BestDistance___best_items].val; /* _best_items on */ +if (unlikely(var25 == NULL)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} +PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _best_items"); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 562); +fatal_exit(1); +} +var23 = var25; +RET_LABEL24:(void)0; +} +} +{ +((void(*)(val* self))((((long)var23&3)?class_info[((long)var23&3)]:var23->class)->vft[COLOR_core__abstract_collection__RemovableCollection__clear]))(var23); /* clear on */ +} +} else { +} +{ +{ /* Inline more_collections$BestDistance$best_items (self) on */ +var28 = self->attrs[COLOR_more_collections__BestDistance___best_items].val; /* _best_items on */ +if (unlikely(var28 == NULL)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} +PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _best_items"); +PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 562); +fatal_exit(1); +} +var26 = var28; +RET_LABEL27:(void)0; +} +} +{ +((void(*)(val* self, val* p0))((((long)var26&3)?class_info[((long)var26&3)]:var26->class)->vft[COLOR_core__abstract_collection__SimpleCollection__add]))(var26, var_candidate); /* add on */ +} +var = 1; +goto RET_LABEL; +RET_LABEL:; +return var; +} +/* method more_collections$BestDistance$init for (self: BestDistance[nullable Object]) */ +void more_collections___more_collections__BestDistance___core__kernel__Object__init(val* self) { +{ +((void(*)(val* self))(self->class->vft[COLOR_more_collections___more_collections__BestDistance___core__kernel__Object__init]))(self); /* init on */ } RET_LABEL:; }