Remove type visiting in generic visitor
This commit is contained in:
@@ -32,7 +32,7 @@ namespace elna::boot
|
||||
{
|
||||
}
|
||||
|
||||
dependency read_sources(std::istream& entry_point, const char *entry_path)
|
||||
dependency read_source(std::istream& entry_point, const char *entry_path)
|
||||
{
|
||||
driver parse_driver{ entry_path };
|
||||
lexer tokenizer(entry_point);
|
||||
@@ -60,6 +60,25 @@ namespace elna::boot
|
||||
return outcome;
|
||||
}
|
||||
|
||||
error_list analyze_semantics(const char *path, std::unique_ptr<unit>& tree, symbol_bag bag)
|
||||
{
|
||||
name_analysis_visitor name_analyser(path, bag);
|
||||
tree->accept(&name_analyser);
|
||||
|
||||
if (name_analyser.has_errors())
|
||||
{
|
||||
return std::move(name_analyser.errors());
|
||||
}
|
||||
type_analysis_visitor type_analyzer(path);
|
||||
tree->accept(&type_analyzer);
|
||||
|
||||
if (type_analyzer.has_errors())
|
||||
{
|
||||
return std::move(type_analyzer.errors());
|
||||
}
|
||||
return error_list{};
|
||||
}
|
||||
|
||||
std::filesystem::path build_path(const std::vector<std::string>& segments)
|
||||
{
|
||||
std::filesystem::path result;
|
||||
|
Reference in New Issue
Block a user