ISSUE: 判断重复import的逻辑太粗暴,性能可能有问题
// path += L".wo";
std::wstring srcfile, src_full_path;
if (!wo::read_virtual_source(&srcfile, &src_full_path, path + L".wo", wo::wstr_to_str(*lex.source_file).c_str()))
{
// import a::b; cannot open a/b.wo, trying a/b/b.wo
if (!wo::read_virtual_source(&srcfile, &src_full_path, path + L"/" + filename + L".wo", wo::wstr_to_str(*lex.source_file).c_str()))
return token{ lex.parser_error(lexer::errorlevel::error, WO_ERR_CANNOT_OPEN_FILE, path.c_str()) };
}
if (!lex.has_been_imported(wstring_pool::get_pstr(src_full_path))
&& !lex.has_been_imported(wo::crc_64(srcfile.c_str(), 0)))
{