Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site watmath.UUCP
Path: utzoo!watmath!idallen
From: idallen@watmath.UUCP
Newsgroups: net.unix-wizards
Subject: Re: nested if's in csh -- you need blanks!
Message-ID: <7154@watmath.UUCP>
Date: Thu, 1-Mar-84 22:25:02 EST
Article-I.D.: watmath.7154
Posted: Thu Mar  1 22:25:02 1984
Date-Received: Sat, 3-Mar-84 08:14:07 EST
References: <16981@sri-arpa.UUCP>
Organization: U of Waterloo, Ontario
Lines: 21

The routines that scan forward for a closing ENDIF (search and getword)
only recognize words separated by blanks and tabs, unlike the regular
parser, which breaks words on parentheses too.  So, you must say
	if ( ... ) then
		...
	endif
and not
	if( ... ) then
		...
	endif
or
	if ( ... )then
		...
	endif
Otherwise, the scan-forward routines can't find "if(" and ")then" to
nest the if's properly.  Either the regular parser should refuse to
accept "if(", or the scan-forward routines should duplicate the parser's
cleverness.  Considering the amount of double-parsing the CSH Shell
does already, you'd best vote for the first alternative!
-- 
        -IAN!  (Ian! D. Allen)      University of Waterloo