From: George H. <geo...@us...> - 2006-03-16 10:57:46
|
Update of /cvsroot/win32forth/win32forth/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24219/win32forth/src Modified Files: INTERPIF.F Log Message: gah: Modified to issue error -58 and some dexing (work in progress) plus the errors doc file is to be done. Index: INTERPIF.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/INTERPIF.F,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** INTERPIF.F 29 Aug 2005 15:56:27 -0000 1.2 --- INTERPIF.F 16 Mar 2006 10:57:36 -0000 1.3 *************** *** 10,15 **** INTERNAL : definite-word ! bl nextword 0= abort" Input stream exhausted!" ?uppercase ; : match-[str] ( cstr addr len -- cstr fl ) --- 10,18 ---- INTERNAL + -58 Constant THROW_INTERPRETCONDITIONAL + THROW_MSGS LINK, THROW_INTERPRETCONDITIONAL , ," Unmatched Interpreted conditionals!!! " + : definite-word ! bl nextword 0= THROW_INTERPRETCONDITIONAL ?throw ?uppercase ; : match-[str] ( cstr addr len -- cstr fl ) *************** *** 34,39 **** EXTERNAL ! : [else] ( interpretive control structure -- alternate selection ) ! ( -- ) 1 begin ?dup --- 37,47 ---- EXTERNAL ! : [else] ( -- ) \ ANSI TOOLS EXT ! \ *G Compilation: Perform the execution semantics given below. ! \ ** Execution: ( "<spaces>name" ... -- ) ! \ ** Skipping leading spaces, parse and discard space-delimited words from the parse area, ! \ ** including nested occurrences of [IF] ... [THEN] and [IF] ... [ELSE] ... [THEN], until ! \ ** the word [THEN] has been parsed and discarded. If the parse area becomes exhausted, ! \ ** it is refilled as with REFILL. [ELSE] is an immediate word. 1 begin ?dup *************** *** 42,59 **** repeat ; immediate ! : [if] ( interpretive control structure -- select on true ) ! ( flag -- ) 0= if postpone [else] then ; immediate ! : [then] ( interpretive control structure -- end the structure ) ! ( -- ) ; immediate ! : [endif] ( interpretive control structure -- end the structure ) ! ( -- ) ; immediate ! : #else ( the alternative selection ) ! ( -- ) 1 begin ?dup --- 50,87 ---- repeat ; immediate ! : [if] ( flag -- ) \ ANSI TOOLS EXT ! \ *G Compilation: Perform the execution semantics given below. ! \ ** Execution: ( flag | flag "<spaces>name" ... -- ) ! \ ** If flag is true, do nothing. Otherwise, skipping leading spaces, parse and discard ! \ ** space-delimited words from the parse area, including nested occurrences of ! \ ** [IF] ... [THEN], [IF] ... [ELSE] ... [THEN], [IF] ... [ENDIF] and ! \ ** [IF] ... [ELSE] ... [ENDIF], until either the word [ELSE], ! \ ** the word [THEN] or the word [ENDIF] has been parsed and discarded. ! \ ** If the parse area becomes exhausted, it is refilled as with REFILL. ! \ ** [IF] is an immediate word. ! \ ** An ambiguous condition exists if [IF] is POSTPONEd. ! \ ** If the end of the input buffer is reached and cannot be refilled before the terminating ! \ ** [ELSE], [THEN] or [ENDIF] is parsed then error -58 is thrown. 0= if postpone [else] then ; immediate ! : [then] ( -- ) \ ANSI TOOLS EXT ! \ *G Compilation: Perform the execution semantics given below. ! \ ** Execution: ( -- ) ! \ ** Does nothing. [THEN] is an immediate word. ; immediate ! : [endif] ( -- ) \ W32F TOOLS EXTRA ! \ *G Compilation: Perform the execution semantics given below. ! \ ** Execution: ( -- ) ! \ ** Does nothing. [ENDIF] is an immediate word. ; immediate ! : #else ( -- ) \ W32F TOOLS EXTRA ! \ *G Compilation: Perform the execution semantics given below. ! \ ** Execution: ( "<spaces>name" ... -- ) ! \ ** Skipping leading spaces, parse and discard space-delimited words from the parse area, ! \ ** including nested occurrences of #IF ... #THEN and #IF ... #ELSE ... #THEN, until ! \ ** the word #THEN has been parsed and discarded. If the parse area becomes exhausted, ! \ ** it is refilled as with REFILL. #ELSE is an immediate word. 1 begin ?dup *************** *** 62,75 **** repeat ; immediate ! : #if ( begin the interpretive control structure ) ! ( flag -- ) 0= if postpone #else then ; immediate ! : #then ( mark the end of the interpretive control structure ) ! ( -- ) ; immediate ! : #endif ( mark the end of the interpretive control structure ) ! ( -- ) ; immediate --- 90,118 ---- repeat ; immediate ! : #if ( flag -- ) \ W32F TOOLS EXTRA ! \ *G Compilation: Perform the execution semantics given below. ! \ ** Execution: ( flag | flag "<spaces>name" ... -- ) ! \ ** If flag is true, do nothing. Otherwise, skipping leading spaces, parse and discard ! \ ** space-delimited words from the parse area, including nested occurrences of ! \ ** #IF ... #THEN, #IF ... #ELSE ... #THEN, #IF ... #ENDIF and ! \ ** #IF ... #ELSE ... #ENDIF, until either the word #ELSE, ! \ ** the word #THEN or the word #ENDIF has been parsed and discarded. ! \ ** If the parse area becomes exhausted, it is refilled as with REFILL. ! \ ** #IF is an immediate word. ! \ ** An ambiguous condition exists if #IF is POSTPONEd. ! \ ** If the end of the input buffer is reached and cannot be refilled before the terminating ! \ ** #ELSE, #THEN or #ENDIF is parsed then error -58 is thrown. 0= if postpone #else then ; immediate ! : #then ( -- ) \ W32F TOOLS EXTRA ! \ *G Compilation: Perform the execution semantics given below. ! \ ** Execution: ( -- ) ! \ ** Does nothing. #THEN is an immediate word. ; immediate ! : #endif ( -- ) \ W32F TOOLS EXTRA ! \ *G Compilation: Perform the execution semantics given below. ! \ ** Execution: ( -- ) ! \ ** Does nothing. #ENDIF is an immediate word. ; immediate |