Support old-style (), bug467.

This commit is contained in:
Wilson Snyder
2017-01-09 19:19:21 -05:00
parent 2f34132275
commit f942aba855
7 changed files with 42 additions and 7 deletions
+11
View File
@@ -377,6 +377,17 @@ private:
}
virtual void visit(AstSFormatF* nodep) {
nodep->iterateChildren(*this);
// Cleanup old-school displays without format arguments
if (!nodep->hasFormat()) {
if (nodep->text()!="") nodep->v3fatalSrc("Non-format $sformatf should have \"\" format");
if (nodep->exprsp()->castConst()
&& nodep->exprsp()->castConst()->num().isFromString()) {
AstConst* fmtp = nodep->exprsp()->unlinkFrBack()->castConst();
nodep->text(fmtp->num().toString());
pushDeletep(fmtp); VL_DANGLING(fmtp);
}
nodep->hasFormat(true);
}
string newFormat = expectFormat(nodep, nodep->text(), nodep->exprsp(), false);
nodep->text(newFormat);
if ((nodep->backp()->castDisplay() && nodep->backp()->castDisplay()->displayType().needScopeTracking())