Create a generic type for types with an error list

This commit is contained in:
2025-03-12 00:23:51 +01:00
parent f739194e06
commit c9a8ecdc0a
13 changed files with 79 additions and 46 deletions

View File

@ -63,18 +63,23 @@ namespace gcc
return error_mark_node;
}
void do_semantic_analysis(const char *path, std::unique_ptr<boot::program>& ast,
std::shared_ptr<symbol_table> symbols)
std::deque<std::unique_ptr<boot::error>> do_semantic_analysis(const char *path,
std::unique_ptr<boot::program>& ast, std::shared_ptr<symbol_table> symbols)
{
auto info_table = boot::builtin_symbol_table();
boot::declaration_visitor declaration_visitor(path, info_table);
declaration_visitor.visit(ast.get());
for (auto unresolved : declaration_visitor.unresolved)
if (declaration_visitor.errors().empty())
{
auto inner_alias = get_inner_alias(symbols, boot::type(unresolved.second));
symbols->enter(unresolved.first, inner_alias);
for (auto unresolved : declaration_visitor.unresolved)
{
auto inner_alias = get_inner_alias(symbols, boot::type(unresolved.second));
symbols->enter(unresolved.first, inner_alias);
}
}
return std::move(declaration_visitor.errors());
}
generic_visitor::generic_visitor(std::shared_ptr<symbol_table> symbol_table)