Fix error message continuations to avoid linenumber repetition

This commit is contained in:
Wilson Snyder
2019-07-11 19:15:40 -04:00
parent 13a20c5ee9
commit dacf45fea9
18 changed files with 39 additions and 27 deletions
+8 -1
View File
@@ -247,6 +247,13 @@ void FileLine::v3errorEnd(std::ostringstream& str) {
}
string FileLine::warnMore() const {
if (m_lineno) {
return V3Error::warnMore()+string(ascii().size(), ' ')+": ";
} else {
return V3Error::warnMore();
}
}
string FileLine::warnOther() const {
if (m_lineno) {
return V3Error::warnMore()+ascii()+": ";
} else {
@@ -261,7 +268,7 @@ string FileLine::warnContext(bool secondary) const {
if (!secondary) { // Avoid printing long paths on informational part of error
for (FileLine* parentFl = parent(); parentFl; parentFl = parentFl->parent()) {
if (parentFl->filenameIsGlobal()) break;
out += parentFl->warnMore()+"... note: In file included from "
out += parentFl->warnOther()+"... note: In file included from "
+parentFl->filebasename()+"\n";
}
}