** Global Data
***************************************************************/
-char gScratch[TIB_SIZE];
+char gScratch[TIB_SIZE];
pfTaskData_t *gCurrentTask = NULL;
pfDictionary_t *gCurrentDictionary;
-cell_t gNumPrimitives;
+cell_t gNumPrimitives;
-ExecToken gLocalCompiler_XT; /* custom compiler for local variables */
-ExecToken gNumberQ_XT; /* XT of NUMBER? */
-ExecToken gQuitP_XT; /* XT of (QUIT) */
-ExecToken gAcceptP_XT; /* XT of ACCEPT */
+ExecToken gLocalCompiler_XT; /* custom compiler for local variables */
+ExecToken gNumberQ_XT; /* XT of NUMBER? */
+ExecToken gQuitP_XT; /* XT of (QUIT) */
+ExecToken gAcceptP_XT; /* XT of ACCEPT */
/* Depth of data stack when colon called. */
-cell_t gDepthAtColon;
+cell_t gDepthAtColon;
/* Global Forth variables. */
cell_t gVarContext; /* Points to last name field. */
cell_t gVarReturnCode; /* Returned to caller of Forth, eg. UNIX shell. */
/* data for INCLUDE that allows multiple nested files. */
-IncludeFrame gIncludeStack[MAX_INCLUDE_DEPTH];
-cell_t gIncludeIndex;
+IncludeFrame gIncludeStack[MAX_INCLUDE_DEPTH];
+cell_t gIncludeIndex;
static void pfResetForthTask( void );
static void pfInit( void );
#define M_DUP PUSH_TOS;
#define M_DROP { TOS = M_POP; }
+#define ASCII_EOT (0x04)
/***************************************************************
** Macros for Floating Point stack access.
case ID_KEY:
PUSH_TOS;
TOS = ioKey();
+ if (TOS == ASCII_EOT) {
+ M_THROW(THROW_BYE);
+ }
endcase;
#ifndef PF_NO_SHELL
/* ACCEPT is deferred so we call it through the dictionary. */
PUSH_DATA_STACK( gCurrentTask->td_SourcePtr );
PUSH_DATA_STACK( TIB_SIZE );
- pfCatch( gAcceptP_XT );
+ ThrowCode throwCode = pfCatch( gAcceptP_XT );
+ if (throwCode) {
+ Result = throwCode;
+ goto error;
+ }
Num = POP_DATA_STACK;
if( Num < 0 )
{