subckt.c, do not put model names into numparam hash table xpressn.c, re-enable error message to alert name redefinition

This commit is contained in:
h_vogt 2016-04-17 16:34:20 +02:00 committed by rlar
parent 34844c9e1d
commit fa681584f4
2 changed files with 13 additions and 7 deletions

View File

@ -528,8 +528,17 @@ nupa_define(dico_t *dico,
Subcircuit expansion is o.k., we have to deal with this numparam
behaviour later. (H. Vogt 090426)
*/
if (0)
message(dico, "%s: cannot redefine\n", t);
message(dico, "%s is already used,\n cannot be redefined\n", t);
#if 0
if ((c == 'U') && (tpe == 'U'))
message(dico, "%s is already used as subcircuit name,\n cannot be used for another subcircuit\n", t);
else if ((c == 'U') && (tpe == 'O'))
message(dico, "%s is already used as subcircuit name,\n cannot be used for model\n", t);
else if ((c == 'O') && (tpe == 'U'))
message(dico, "%s is already used as model name,\n cannot be used for subcircuit\n", t);
else if ((c == 'O') && (tpe == 'O'))
message(dico, "%s is already used as model name,\n cannot be reused for another model\n", t);
#endif
}
}

View File

@ -235,13 +235,10 @@ inp_subcktexpand(struct line *deck) {
#endif
ok = nupa_signal(NUPADECKCOPY, NULL);
/* get the subckt/model names from the deck */
for (c = deck; c; c = c->li_next) { /* first Numparam pass */
/* get the subckt names from the deck */
for (c = deck; c; c = c->li_next) /* first Numparam pass */
if (ciprefix(".subckt", c->li_line))
nupa_scan(c->li_line, c->li_linenum, TRUE);
if (ciprefix(".model", c->li_line))
nupa_scan(c->li_line, c->li_linenum, FALSE);
}
/* now copy instances */
for (c = deck; c; c = c->li_next) /* first Numparam pass */
c->li_line = nupa_copy(c->li_line, c->li_linenum);