In case of resistor valuues r150 (r + integer number),

return 150
R2 n1 n2 r150

In case of r23mod return error = 1 and val = 0, so
r23mod may be read as a model, not an instance parameter
R3 n3 n4 r23mod
This commit is contained in:
Holger Vogt 2022-04-06 16:01:45 +02:00
parent a0ee275b08
commit 2915f8e991
1 changed files with 20 additions and 4 deletions

View File

@ -221,8 +221,8 @@ INPevaluateRKM_R(char** line, int* error, int gobble)
tmpline = *line;
if (gobble) {
/* MW. INPgetUTok should be called with gobble=0 or it make
* errors in v(1,2) exp */
/* MW. INPgetUTok should be called with gobble=0 or it leads to
* errors in v(1,2) expression */
*error = INPgetUTok(line, &token, 0);
if (*error)
return (0.0);
@ -363,8 +363,24 @@ INPevaluateRKM_R(char** line, int* error, int gobble)
break;
case 'r':
case 'R':
expo1 = expo1;
hasmulti = TRUE;
/* This should be R150, i.e. R followed by an integer number */
{
int num;
char ch;
if (sscanf(here + 1, "%i%c", &num, &ch) == 1) {
expo1 = expo1;
hasmulti = TRUE;
}
else {
*error = 1;
if (gobble) {
FREE(token);
/* back out the 'gettok' operation */
*line = tmpline;
}
return (0);
}
}
break;
case 'n':
case 'N':