Browse Source

Enable strings as parameters across subckt boundaries

by keeping the quotes and excluding {} around the string token.
pre-master-46
Holger Vogt 1 year ago
parent
commit
2db9533380
  1. 10
      src/frontend/inpcom.c
  2. 4
      src/frontend/numparam/xpressn.c

10
src/frontend/inpcom.c

@ -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 {

4
src/frontend/numparam/xpressn.c

@ -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 == '{') {

Loading…
Cancel
Save