Fix Bug #623 - "Parser warning for voltage source".

Do not warn when a single-element vector lacks parentheses.
This commit is contained in:
Giles Atkinson 2023-05-02 12:24:39 +01:00 committed by Holger Vogt
parent 422a205409
commit 1fdf7dac51
1 changed files with 4 additions and 2 deletions

View File

@ -53,7 +53,8 @@ INPgetValue(CKTcircuit *ckt, char **line, int type, INPtables *tab)
list[temp.v.numValue - 1] = tmp;
tmp = INPevaluate(line, &error, 1);
}
if (error && ft_ngdebug && !eq(*line, "") && !prefix(")", *line)) {
if (error && ft_ngdebug && !eq(*line, "") && !prefix(")", *line) &&
temp.v.numValue > 1) {
fprintf(stderr, "\nWarning: Reading a vector without limiting parens may be dangerous\n%s\nat\n", compline);
fprintf(stderr, "%*s%s\n", (int)(*line - compline)," ", *line);
}
@ -76,7 +77,8 @@ INPgetValue(CKTcircuit *ckt, char **line, int type, INPtables *tab)
ilist[temp.v.numValue - 1] = (int) floor(0.5 + tmp);
tmp = INPevaluate(line, &error, 1);
}
if (error && ft_ngdebug && !eq(*line, "") && !prefix(")", *line)) {
if (error && ft_ngdebug && !eq(*line, "") && !prefix(")", *line) &&
temp.v.numValue > 1) {
fprintf(stderr, "\nWarning: Reading a vector without limiting parens may be dangerous\n%s\nat\n", compline);
fprintf(stderr, "%*s%s\n", (int)(*line - compline), " ", *line);
}