Enable strings as parameters across subckt boundaries
by keeping the quotes and excluding {} around the string token.
This commit is contained in:
parent
07994ff225
commit
2db9533380
|
|
@ -3304,7 +3304,12 @@ void inp_casefix(char *string)
|
||||||
tmpstr = strstr(string, "file=\"");
|
tmpstr = strstr(string, "file=\"");
|
||||||
|
|
||||||
#endif
|
#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) {
|
while (*string) {
|
||||||
#ifdef XSPICE
|
#ifdef XSPICE
|
||||||
|
|
@ -3914,7 +3919,8 @@ static int inp_get_params(
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
|
|
||||||
if (*value == '{' || isdigit_c(*value) ||
|
if (*value == '{' || isdigit_c(*value) ||
|
||||||
(*value == '.' && isdigit_c(value[1]))) {
|
(*value == '.' && isdigit_c(value[1])) ||
|
||||||
|
(*value == '\"')) {
|
||||||
value = copy(value);
|
value = copy(value);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -1623,8 +1623,8 @@ nupa_subcktcall(dico_t *dico, const char *s, const char *x,
|
||||||
char *kp = jp;
|
char *kp = jp;
|
||||||
ds_clear(&ustr);
|
ds_clear(&ustr);
|
||||||
|
|
||||||
if (alfanum(*kp) || *kp == '.') {
|
if (alfanum(*kp) || *kp == '.' || *kp == '\"') {
|
||||||
/* number, identifier */
|
/* number, identifier, string */
|
||||||
jp = skip_non_ws(kp);
|
jp = skip_non_ws(kp);
|
||||||
pscopy(&ustr, kp, jp);
|
pscopy(&ustr, kp, jp);
|
||||||
} else if (*kp == '{') {
|
} else if (*kp == '{') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue