Enable strings as parameters across subckt boundaries

by keeping the quotes and excluding {} around the string token.
This commit is contained in:
Holger Vogt 2024-11-27 23:35:07 +01:00
parent 07994ff225
commit 2db9533380
2 changed files with 10 additions and 4 deletions

View File

@ -3304,7 +3304,12 @@ void inp_casefix(char *string)
tmpstr = strstr(string, "file=\"");
#endif
keepquotes = ciprefix(".param", string); // Allow string params
/* Allow string params */
keepquotes = ciprefix(".param", string);
/* Allow string param in .subckt lines */
keepquotes = keepquotes || (ciprefix(".subckt", string) && (strstr(string, "=\"")));
/* Keep quoted strings in X lines */
keepquotes = keepquotes || (*string == 'x' && strchr(string, '\"'));
while (*string) {
#ifdef XSPICE
@ -3914,7 +3919,8 @@ static int inp_get_params(
*end = '\0';
if (*value == '{' || isdigit_c(*value) ||
(*value == '.' && isdigit_c(value[1]))) {
(*value == '.' && isdigit_c(value[1])) ||
(*value == '\"')) {
value = copy(value);
}
else {

View File

@ -1623,8 +1623,8 @@ nupa_subcktcall(dico_t *dico, const char *s, const char *x,
char *kp = jp;
ds_clear(&ustr);
if (alfanum(*kp) || *kp == '.') {
/* number, identifier */
if (alfanum(*kp) || *kp == '.' || *kp == '\"') {
/* number, identifier, string */
jp = skip_non_ws(kp);
pscopy(&ustr, kp, jp);
} else if (*kp == '{') {