/*****************************************************************************

	SkpF()

	This function is called by SkpCmd to skip a command which starts
with an F.

*****************************************************************************/

#include "ZPort.h"		/* define portability identifiers */
#include "DefTeco.h"		/* define general identifiers */
#include "ChrMacs.h"		/* define character processing macros */
#include "DefError.h"		/* define identifiers for error messages */

extern	VOID	ErrMsg();	/* display an error message */
extern	DEFAULT	SkpArg();	/* skip a command with a text argument */
extern	DEFAULT	SkpDAr();	/* skip a command with two text arguments */
extern	DEFAULT	SkpSkp();	/* skip nothing */

EXTERN	char	*CBfPtr;	/* pointer into command string */
EXTERN	char	*CStEnd;	/* pointer to last char of command string */
EXTERN	WORD	MStTop;		/* top of macro stack */


DEFAULT SkpF()			/* skip one of the F commands */
{
	static char *ErrTxt = "x";

	if (CBfPtr == CStEnd)
		if (MStTop < 0)			/* if not in a macro */
			{
			ErrMsg(ERR_UTC);
			return(FAILURE);
			}
		else
			return(SUCCESS);
	++CBfPtr;

	switch (To_Upper(*CBfPtr)) {
		case 'S':
		case 'N':
		case 'C':
		case '_':	return(SkpDAr());
		case 'D':
		case 'R':
		case 'B':
		case 'K':	return(SkpArg());
		case '>':
		case '<':
		case '\'':
		case '|':	return(SkpSkp());
		default:
				*ErrTxt = *CBfPtr;
				ErrMsg(ERR_IFC, ErrTxt);
				return(FAILURE);
	}
}
