TEACL is a fork of TECOC created for the purpose of describing diffs in a document being collaboratively edited
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
1.2 KiB

/*****************************************************************************
ExeGtr()
This function executes a greater-than-sign (>) command.
> End iteration
*****************************************************************************/
#include "zport.h" /* define portability identifiers */
#include "tecoc.h" /* define general identifiers */
#include "defext.h" /* define external global variables */
#include "deferr.h" /* define identifiers for error messages */
DEFAULT ExeGtr() /* execute a > command */
{
DBGFEN(1,"ExeGtr",NULL);
if (LStTop == LStBot) { /* if not in loop */
ErrMsg(ERR_BNI); /* BNI = > not in iteration */
DBGFEX(1,DbgFNm,"FAILURE");
return FAILURE;
}
if (LStack[LStTop].LIndex != INFINITE) {/* if not infinite loop */
--LStack[LStTop].LIndex; /* decrement loop counter */
}
if ((LStack[LStTop].LIndex == INFINITE) || /* if infinite loop */
(LStack[LStTop].LIndex > 0)) { /* or more iterations to do */
CBfPtr = LStack[LStTop].LAddr; /* jump to front of loop */
} else {
--LStTop; /* leave the loop */
}
CmdMod = '\0'; /* clear modifiers flags */
EStTop = EStBot; /* clear expression stack */
DBGFEX(1,DbgFNm,"SUCCESS");
return SUCCESS;
}