frontend/cpitf.c, cp_istrue(), cleanup comments

This commit is contained in:
h_vogt 2016-02-18 20:07:04 +01:00 committed by rlar
parent f52a12a95a
commit e60f2f63e1
1 changed files with 11 additions and 1 deletions

View File

@ -294,7 +294,10 @@ ft_cpinit(void)
}
/* Decide whether a condition is TRUE or not. */
/* Decide whether a condition is TRUE or not.
* In erroneous situations the condition shall evaluate to FALSE
* additionally error messages might have been printed.
*/
bool
cp_istrue(wordlist *wl)
@ -309,14 +312,21 @@ cp_istrue(wordlist *wl)
/* return FALSE if this did not expand to anything */
if (!wl)
return FALSE;
/* backquote '`' substitution */
wl = cp_bquote(wl);
/* strip bit number eight */
cp_striplist(wl);
/* parse the condition */
names = ft_getpnames(wl, TRUE);
wl_free(wl);
/* evaluate the parsed condition.
* boolean expressions evaluate to real 1.0 or 0.0 */
v = ft_evaluate(names);
/* non boolean expressions will be considered TRUE
* if at least one real or complex vector element is non zero */
rv = !vec_iszero(v);
/* va: garbage collection for v, if pnode names is no simple value */