mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 05:47:42 +02:00
The tc for R, L, C may include an expression
like tc={expression} or tc={expression}, 1.3u or
tc={expression}, {expression2}
This commit is contained in:
+18
-2
@@ -8819,6 +8819,7 @@ static struct card *pspice_compat(struct card *oldcard)
|
|||||||
}
|
}
|
||||||
char *tctok = search_plain_identifier(ntok, "tc");
|
char *tctok = search_plain_identifier(ntok, "tc");
|
||||||
if (tctok) {
|
if (tctok) {
|
||||||
|
char *tc1, *tc2;
|
||||||
char *tctok1 = strchr(tctok, '=');
|
char *tctok1 = strchr(tctok, '=');
|
||||||
if (tctok1)
|
if (tctok1)
|
||||||
/* skip '=' */
|
/* skip '=' */
|
||||||
@@ -8826,8 +8827,23 @@ static struct card *pspice_compat(struct card *oldcard)
|
|||||||
else
|
else
|
||||||
/* no '=' found, skip 'tc' */
|
/* no '=' found, skip 'tc' */
|
||||||
tctok1 = tctok + 2;
|
tctok1 = tctok + 2;
|
||||||
char *tc1 = gettok_node(&tctok1);
|
/* tc1 may be an expression, enclosed in {} */
|
||||||
char *tc2 = gettok_node(&tctok1);
|
if (*tctok1 == '{') {
|
||||||
|
tc1 = gettok_char(&tctok1, '}', TRUE, TRUE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tc1 = gettok_node(&tctok1);
|
||||||
|
}
|
||||||
|
/* skip spaces and commas */
|
||||||
|
while (isspace_c(*tctok1) || (*tctok1 == ','))
|
||||||
|
tctok1++;
|
||||||
|
/* tc2 may be an expression, enclosed in {} */
|
||||||
|
if (*tctok1 == '{') {
|
||||||
|
tc2 = gettok_char(&tctok1, '}', TRUE, TRUE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tc2 = gettok_node(&tctok1);
|
||||||
|
}
|
||||||
tctok[-1] = '\0';
|
tctok[-1] = '\0';
|
||||||
char *newstring;
|
char *newstring;
|
||||||
if (tc1 && tc2)
|
if (tc1 && tc2)
|
||||||
|
|||||||
Reference in New Issue
Block a user