When showing an error, show source code.

This commit is contained in:
Wilson Snyder
2019-07-14 21:42:03 -04:00
parent a4820fc700
commit 97561bf064
175 changed files with 1266 additions and 262 deletions
+4
View File
@@ -1024,8 +1024,12 @@ void AstNode::dumpPtrs(std::ostream& os) const {
}
void AstNode::dumpTree(std::ostream& os, const string& indent, int maxDepth) {
static int s_debugFileline = v3Global.opt.debugSrcLevel("fileline"); // --debugi-fileline 9
os<<indent<<" "<<this<<endl;
if (debug()>8) { os<<indent<<" "; dumpPtrs(os); }
if (s_debugFileline >= 9) {
os<<fileline()->warnContextSecondary();
}
if (maxDepth==1) {
if (op1p()||op2p()||op3p()||op4p()) { os<<indent<<"1: ...(maxDepth)"<<endl; }
} else {