1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-29 11:24:36 +03:00
This commit is contained in:
Rui Ueyama 2021-03-27 10:15:38 +09:00
parent 7c1d3a1559
commit 3c7ca2b3d9

View File

@ -6,6 +6,7 @@
#include "mold.h"
#include <cctype>
#include <iomanip>
static thread_local MemoryMappedFile *current_file;
@ -42,7 +43,7 @@ public:
std::stringstream ss;
ss << current_file->name << ":" << lineno << ": ";
i64 indent = ss.tellp();
ss << line << "\n" << std::string(indent + column, ' ') << "^ ";
ss << line << "\n" << std::setw(indent + column) << " " << "^ ";
out << ss.str();
}
@ -93,6 +94,9 @@ static std::vector<std::string_view> tokenize(std::string_view input) {
if (pos == 0)
pos = 1;
else if (pos == input.npos)
pos = input.size();
vec.push_back(input.substr(0, pos));
input = input.substr(pos);
}