Skip to content

Commit

Permalink
better connection printing
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanohar committed Jul 3, 2019
1 parent 18ddbda commit 137916c
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions act/scope.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1153,22 +1153,39 @@ static void _print_connections (FILE *fp, act_connection *cx)
ActConniter ci(cx);
ActId *id;
int first = 1;
int global;

global = cx->isglobal();
if (cx->isPrimary()) {
if (ci.begin() != ci.end() && (++ci.begin() != ci.end())) {
for (ci = ci.begin(); ci != ci.end(); ci++) {
act_connection *c = *ci;
if (!first) {
fprintf (fp, "=");

if (!global || c->isglobal()) {
if (!first) {
fprintf (fp, "=");
}
id = c->toid();
first = 0;
id->Print (fp);
delete id;
}
id = c->toid();
first = 0;
id->Print (fp);
delete id;
}
fprintf (fp, ";\n");
}
}
else {
if (!global && cx->primary()->isglobal()) {
id = cx->toid();
id->Print (fp);
delete id;
id = cx->primary()->toid();
fprintf (fp, "=");
id->Print (fp);
delete id;
fprintf (fp, ";\n");
}
}
if (cx->hasSubconnections()) {
for (int i=0; i < cx->numSubconnections(); i++) {
if (cx->hasSubconnections(i)) {
Expand Down

0 comments on commit 137916c

Please sign in to comment.