Move command line handling into a module

This commit is contained in:
2025-08-15 18:37:40 +03:00
parent cec020ea92
commit f880e3d2d7
6 changed files with 25 additions and 81 deletions

View File

@@ -85,12 +85,15 @@ static elna::boot::dependency elna_parse_file(dependency_state& state, const cha
for (const auto& sub_tree : outcome.tree->imports)
{
std::filesystem::path sub_path = "source" / elna::boot::build_path(sub_tree->segments);
std::unordered_map<std::filesystem::path, elna::boot::symbol_bag>::const_iterator cached_import =
state.cache.find(sub_path);
if (state.cache.find(sub_path) == state.cache.end())
if (cached_import == state.cache.end())
{
elna_parse_file(state, state.allocate_path(sub_path));
elna_parse_file(state, sub_path.c_str());
cached_import = state.cache.find(sub_path);
}
outcome_bag.add_import(state.cache.find(sub_path)->second);
outcome_bag.add_import(cached_import->second);
}
elna::boot::error_list semantic_errors = analyze_semantics(filename, outcome.tree, outcome_bag);