41be6622a4808784ce80f856cb600f8bc805b9b0
static char sccsid
[] = "@(#)4.brace.c 4.1 (Berkeley) %G%";
ndbrace(v
) /* determine whether braces needed around subparts of v */
/* return TRUE if v ends with IF THEN not in braces */
for (i
= 0; i
< CHILDNUM(v
); ++i
)
for (w
= LCHILD(v
,i
); DEFINED(w
); w
= RSIB(w
))
if (NTYPE(v
) != DUMVX
&& NTYPE(v
) != ITERVX
&&
(!DEFINED(LCHILD(v
,i
)) || compound(v
,i
) ||
(endif
&& NTYPE(v
) == IFVX
&& !IFTHEN(v
) && i
== THEN
)))
/* DUMVX doesn't nest, ITERVX doen't nest since
nesting is done at LOOPNODE, etc., must
check for IFTHEN followed by unrelated ELSE */
return(endif
|| IFTHEN(v
) );
compound(v
,ch
) /* return TRUE iff subpart ch of v has multiple statements */
ASSERT(DEFINED(NXT(w
)),compound
);
return(TRUE
); /* loop ends with labeled CONTINUE statement */
else if (DEFINED(RSIB(w
)))
else if (NTYPE(w
) == STLNVX
&& CODELINES(w
) > 1)