inpcom.c: repeated call to inp_fix_ternary_operator_str

in inp_fix_ternary_operator, only lines beginning with .
selected, comments updated
This commit is contained in:
h_vogt
2013-12-31 16:24:59 +01:00
committed by rlar
parent 4a20c45db2
commit 0d1666da29
+13 -16
View File
@@ -1968,6 +1968,11 @@ inp_fix_ternary_operator_str(char *line, bool all)
} }
/* a>b?c:b ---> ternary_fcn(a>b, c, d)
for .func, .param, and .meas lines.
ternary functions for r, l, and c lines are handled in inp_compat(),
ternary functions in B-source are handled by the B-source parser */
static void static void
inp_fix_ternary_operator(struct line *card) inp_fix_ternary_operator(struct line *card)
{ {
@@ -1977,25 +1982,17 @@ inp_fix_ternary_operator(struct line *card)
char *line = card->li_line; char *line = card->li_line;
if (*line == '*') if (*line != '.')
continue; continue;
/* exclude replacement of ternary function between .control and .endc */ /* .param, .func, and .meas lines handled here (2nd argument FALSE).
if (ciprefix(".control", line)) The while loop cares for two or more ternary functions at top level,
found_control = TRUE; nesting is taken care of by recursive action inside of
if (ciprefix(".endc", line)) inp_fix_ternary_operator_str */
found_control = FALSE; while (strchr(line, '?') && strchr(line, ':')) {
if (found_control)
continue;
/* ternary operator for B source done elsewhere */
if (*line == 'B' || *line == 'b')
continue;
/* .param, .func, and .meas lines handled here (2nd argument FALSE) */
if (strchr(line, '?') && strchr(line, ':'))
card->li_line = inp_fix_ternary_operator_str(line, FALSE); card->li_line = inp_fix_ternary_operator_str(line, FALSE);
line = card->li_line;
}
} }
} }