mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 13:57:32 +02:00
Bail out if {...} or '...' are missing around RHS of the equation.
(...) may be possible, elsewhere additional {} are put around,
so we have {(...)}.
This commit is contained in:
+9
-24
@@ -6240,14 +6240,9 @@ static void inp_compat(struct card *card)
|
|||||||
/* Find equation, starts with '{', till end of line */
|
/* Find equation, starts with '{', till end of line */
|
||||||
str_ptr = strchr(cut_line, '{');
|
str_ptr = strchr(cut_line, '{');
|
||||||
if (str_ptr == NULL) {
|
if (str_ptr == NULL) {
|
||||||
/* if not, equation may start with a '(' */
|
fprintf(stderr, "ERROR: mal formed R line: %s\n", curr_line);
|
||||||
str_ptr = strchr(cut_line, '(');
|
fprintf(stderr, " {...} or '...' around equation's right hand side are missing!\n");
|
||||||
if (str_ptr == NULL) {
|
controlled_exit(EXIT_FAILURE);
|
||||||
fprintf(stderr, "ERROR: mal formed R line: %s\n",
|
|
||||||
curr_line);
|
|
||||||
controlled_exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
equation = gettok_char(&str_ptr, ')', TRUE, TRUE);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
equation = gettok_char(&str_ptr, '}', TRUE, TRUE);
|
equation = gettok_char(&str_ptr, '}', TRUE, TRUE);
|
||||||
@@ -6324,14 +6319,9 @@ static void inp_compat(struct card *card)
|
|||||||
/* Find equation, starts with '{', till end of line */
|
/* Find equation, starts with '{', till end of line */
|
||||||
str_ptr = strchr(cut_line, '{');
|
str_ptr = strchr(cut_line, '{');
|
||||||
if (str_ptr == NULL) {
|
if (str_ptr == NULL) {
|
||||||
/* if not, equation may start with a '(' */
|
fprintf(stderr, "ERROR: mal formed C line: %s\n", curr_line);
|
||||||
str_ptr = strchr(cut_line, '(');
|
fprintf(stderr, " {...} or '...' around equation's right hand side are missing!\n");
|
||||||
if (str_ptr == NULL) {
|
controlled_exit(EXIT_FAILURE);
|
||||||
fprintf(stderr, "ERROR: mal formed C line: %s\n",
|
|
||||||
curr_line);
|
|
||||||
controlled_exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
equation = gettok_char(&str_ptr, ')', TRUE, TRUE);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
equation = gettok_char(&str_ptr, '}', TRUE, TRUE);
|
equation = gettok_char(&str_ptr, '}', TRUE, TRUE);
|
||||||
@@ -6399,14 +6389,9 @@ static void inp_compat(struct card *card)
|
|||||||
/* Find equation, starts with '{', till end of line */
|
/* Find equation, starts with '{', till end of line */
|
||||||
str_ptr = strchr(cut_line, '{');
|
str_ptr = strchr(cut_line, '{');
|
||||||
if (str_ptr == NULL) {
|
if (str_ptr == NULL) {
|
||||||
/* if not, equation may start with a '(' */
|
fprintf(stderr, "ERROR: mal formed L line: %s\n", curr_line);
|
||||||
str_ptr = strchr(cut_line, '(');
|
fprintf(stderr, " {...} or '...' around equation's right hand side are missing!\n");
|
||||||
if (str_ptr == NULL) {
|
controlled_exit(EXIT_FAILURE);
|
||||||
fprintf(stderr, "ERROR: mal formed L line: %s\n",
|
|
||||||
curr_line);
|
|
||||||
controlled_exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
equation = gettok_char(&str_ptr, ')', TRUE, TRUE);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
equation = gettok_char(&str_ptr, '}', TRUE, TRUE);
|
equation = gettok_char(&str_ptr, '}', TRUE, TRUE);
|
||||||
|
|||||||
Reference in New Issue
Block a user