When showing an error, show the instance location

This commit is contained in:
Todd Strader
2019-07-26 12:52:38 -04:00
parent 5560da2934
commit 4a14788c9b
88 changed files with 488 additions and 29 deletions
+6 -1
View File
@@ -49,7 +49,11 @@
void V3Number::v3errorEnd(std::ostringstream& str) const {
std::ostringstream nsstr;
nsstr<<str.str();
m_fileline->v3errorEnd(nsstr);
if (m_nodep) {
m_nodep->v3errorEnd(nsstr);
} else {
m_fileline->v3errorEnd(nsstr);
}
}
//======================================================================
@@ -289,6 +293,7 @@ void V3Number::V3NumberCreate(AstNode* nodep, const char* sourcep, FileLine* fl)
}
void V3Number::setNames(AstNode* nodep) {
m_nodep = nodep;
if (!nodep) return;
m_fileline = nodep->fileline();
}