From fa681584f47e5c3da264f7ea6cdaa7d245fe0ce3 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 17 Apr 2016 16:34:20 +0200 Subject: [PATCH] subckt.c, do not put model names into numparam hash table xpressn.c, re-enable error message to alert name redefinition --- src/frontend/numparam/xpressn.c | 13 +++++++++++-- src/frontend/subckt.c | 7 ++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 87319115d..8e9303cb2 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -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 } } diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 75129c648..70d75d71e 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -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);