parsing error log fix
This commit is contained in:
parent
9695a78bc3
commit
7270e0ba24
@ -20,14 +20,15 @@ parsing_error::parsing_error(
|
|||||||
std::string_view source,
|
std::string_view source,
|
||||||
uint pos,
|
uint pos,
|
||||||
uint line,
|
uint line,
|
||||||
uint linestart)
|
uint linestart
|
||||||
: std::runtime_error(message), filename(filename),
|
) : std::runtime_error(message), filename(filename),
|
||||||
pos(pos), line(line), linestart(linestart) {
|
pos(pos), line(line), linestart(linestart)
|
||||||
|
{
|
||||||
size_t end = source.find("\n", linestart);
|
size_t end = source.find("\n", linestart);
|
||||||
if (end == std::string::npos) {
|
if (end == std::string::npos) {
|
||||||
end = source.length();
|
end = source.length();
|
||||||
}
|
}
|
||||||
source = source.substr(linestart, end-linestart);
|
this->source = source.substr(linestart, end-linestart);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string parsing_error::errorLog() const {
|
std::string parsing_error::errorLog() const {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user