diff --git a/ChangeLog b/ChangeLog index e23d3c17d..c2f254ec4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-04-25 Holger Vogt + * src/frontend/inpcom.c: In inp_fix_param_values() xspice variables of type + complex are recognized also in vectors. + 2008-04-23 Holger Vogt * src/frontend/inpcom.c: In inp_fix_param_values() xspice variables of type complex are recognized. Vectors of complex variables still missing. diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 39bebad5d..a2c42b5a0 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -2512,7 +2512,7 @@ inp_fix_param_values( struct line *deck ) { struct line *c = deck; char *line, *beg_of_str, *end_of_str, *old_str, *equal_ptr, *new_str; - char *vec_str, *natok, *buffer, *newvec; + char *vec_str, *natok, *buffer, *newvec, *whereisgt; bool control_section = FALSE, has_paren = FALSE; int n = 0; wordlist *wl, *nwl; @@ -2582,12 +2582,30 @@ inp_fix_param_values( struct line *deck ) buffer = tmalloc(strlen(natok) + 4); if ( isdigit(*natok) || *natok == '{' || *natok == '.' || *natok == '"' || ( *natok == '-' && isdigit(*(natok+1)) ) || - ciprefix("true", natok) || ciprefix("false", natok)) { + ciprefix("true", natok) || ciprefix("false", natok) || + eq(natok, "<") || eq(natok, ">")) { (void) sprintf(buffer, "%s", natok); - } else if (*natok == '<') { - /* A complex value found inside a vector [< x1 y1> ] */ - /* Code is still missing ! */ - (void) sprintf(buffer, "{%s}", natok); + /* A complex value found inside a vector [< x1 y1> ] */ + /* < xx and yy > have been dealt with before */ + /* */ + } else if (strchr(natok, '>')) { + if (isdigit(*natok) || ( *natok == '-' && isdigit(*(natok+1))) ) { + (void) sprintf(buffer, "%s", natok); + } else { + whereisgt = strchr(natok, '>'); + *whereisgt = '}'; + (void) sprintf(buffer, "{%s>", natok); + } + /* all other tokens */ } else { (void) sprintf(buffer, "{%s}", natok); }