Polymorphs nested structs
This commit is contained in:
@@ -223,6 +223,7 @@ ast_struct(Token *pos, Ast_Scope *scope, Ast_Kind kind, Array<Ast_Decl *> polymo
|
||||
if (polymorph_parameters.len) {
|
||||
result->polymorph_parameters = polymorph_parameters;
|
||||
set_flag(result->flags, AST_POLYMORPH);
|
||||
set_flag(result->flags, AST_PARENT_POLYMORPH);
|
||||
result->polymorphs.allocator = pctx->heap;
|
||||
}
|
||||
return result;
|
||||
@@ -631,6 +632,13 @@ set_flag_typespec(Ast_Expr *expr) {
|
||||
}
|
||||
}
|
||||
|
||||
CORE_Static void
|
||||
unset_polymorph(Ast *ast) {
|
||||
for (Ast_Iter iter = iterate_depth_first(pctx->heap, ast, true); iter.ast; next(&iter)) {
|
||||
unset_flag(iter.ast->flags, AST_POLYMORPH);
|
||||
}
|
||||
}
|
||||
|
||||
CORE_Static bool
|
||||
is_typespec_polymorphic(Ast *ast) {
|
||||
for (Ast_Iter iter = iterate_depth_first(pctx->heap, ast, true); iter.ast; next(&iter)) {
|
||||
|
||||
Reference in New Issue
Block a user