Add an error message for a .model line that includes a default value

for a read-only instance parameter.  Before that caused a fatal error
in parsing the first device to use the model.
This commit is contained in:
Giles Atkinson 2025-03-11 21:09:44 +00:00 committed by Holger Vogt
parent 8ab446fc9c
commit 35ae1ece8c
1 changed files with 11 additions and 5 deletions

View File

@ -149,12 +149,18 @@ create_model(CKTcircuit *ckt, INPmodel *modtmp, INPtables *tab)
if (p) {
char *value;
INPgetTok(&line, &value, 1);
modtmp->INPmodfast->defaults =
wl_cons(copy(parm),
wl_cons(value,
modtmp->INPmodfast->defaults));
INPgetTok(&line, &value, 1);
if (p->dataType & IF_SET) {
modtmp->INPmodfast->defaults =
wl_cons(copy(parm),
wl_cons(value, modtmp->INPmodfast->defaults));
} else {
fprintf(stderr,
"Ignoring attempt to set a default "
"for read-only instance parameter %s in:\n %s\n",
p->keyword, modtmp->INPmodLine->line);
}
} else {
double dval;