@@ -65,7 +65,9 @@ namespace Ark::Diagnostics
6565 else if (maybe_context && !ctx_same_file && !maybe_context->filename .empty ())
6666 {
6767 // show the location of the parent of our error first
68- fmt::print (os, " Error originated from file {}:{}\n " , maybe_context->filename , maybe_context->at .start .line + 1 );
68+ std::string uniformised_filename;
69+ std::ranges::replace_copy (maybe_context->filename , std::back_inserter (uniformised_filename), ' \\ ' , ' /' );
70+ fmt::print (os, " Error originated from file {}:{}\n " , uniformised_filename, maybe_context->at .start .line + 1 );
6971
7072 std::optional<decltype (internal::FilePos::line)> maybe_end_line = std::nullopt ;
7173 if (maybe_context->at .end )
@@ -193,9 +195,11 @@ namespace Ark::Diagnostics
193195 const std::string& filename, const internal::FileSpan& at,
194196 const std::optional<CodeErrorContext>& maybe_context = std::nullopt )
195197 {
198+ std::string uniformised_filename;
199+ std::ranges::replace_copy (filename, std::back_inserter (uniformised_filename), ' \\ ' , ' /' );
196200 makeContext (
197201 ErrorLocation {
198- .filename = filename ,
202+ .filename = uniformised_filename ,
199203 .start = at.start ,
200204 .end = at.end },
201205 os, maybe_context, colorize);
0 commit comments