mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-05 10:14:05 +00:00
Correct odin doc default parameter value init_string generation
This commit is contained in:
@@ -2050,6 +2050,7 @@ void generate_minimum_dependency_set(Checker *c, Entity *start) {
|
||||
|
||||
// WASM Specific
|
||||
str_lit("__ashlti3"),
|
||||
str_lit("__multi3"),
|
||||
};
|
||||
for (isize i = 0; i < gb_count_of(required_runtime_entities); i++) {
|
||||
force_add_dependency_entity(c, c->info.runtime_package->scope, required_runtime_entities[i]);
|
||||
|
||||
@@ -826,6 +826,9 @@ OdinDocEntityIndex odin_doc_add_entity(OdinDocWriter *w, Entity *e) {
|
||||
}
|
||||
if (e->flags & EntityFlag_Static) { flags |= OdinDocEntityFlag_Var_Static; }
|
||||
link_name = e->Variable.link_name;
|
||||
if (init_expr == nullptr) {
|
||||
init_expr = e->Variable.init_expr;
|
||||
}
|
||||
break;
|
||||
case Entity_Procedure:
|
||||
if (e->Procedure.is_foreign) { flags |= OdinDocEntityFlag_Foreign; }
|
||||
@@ -856,8 +859,8 @@ OdinDocEntityIndex odin_doc_add_entity(OdinDocWriter *w, Entity *e) {
|
||||
init_string = odin_doc_write_string(w, make_string_c(exact_value_to_string(e->Constant.value)));
|
||||
}
|
||||
} else if (e->kind == Entity_Variable) {
|
||||
if (e->Variable.param_expr) {
|
||||
init_string = odin_doc_expr_string(w, e->Variable.param_expr);
|
||||
if (e->Variable.param_value.original_ast_expr) {
|
||||
init_string = odin_doc_expr_string(w, e->Variable.param_value.original_ast_expr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,6 @@ struct Entity {
|
||||
i32 field_index;
|
||||
|
||||
ParameterValue param_value;
|
||||
Ast * param_expr;
|
||||
|
||||
String thread_local_model;
|
||||
Entity * foreign_library;
|
||||
|
||||
Reference in New Issue
Block a user