version 1.13, 2005/12/31 15:46:14
|
version 1.14, 2006/02/04 19:26:38
|
Line 194 has? file [IF]
|
Line 194 has? file [IF]
|
terminal-input def#tib new-tib ; |
terminal-input def#tib new-tib ; |
\ s" *the terminal*" loadfilename 2! |
\ s" *the terminal*" loadfilename 2! |
|
|
: execute-parsing ( ... addr u xt -- ... ) \ gforth |
: execute-parsing-wrapper ( ... addr1 u1 xt addr2 u2 -- ... ) \ gforth-internal |
\G Make @i{addr u} the current input source, execute @i{xt @code{( |
\ addr1 u1 is the string to be processed, xt is the word for |
\G ... -- ... )}}, then restore the previous input source. |
\ processing it, addr2 u2 is the name of the input source |
>r evaluate-input cell new-tib |
rot >r 2>r evaluate-input cell new-tib 2r> |
[ has? file [IF] ] |
[ has? file [IF] ] |
s" *evaluated string*" loadfilename 2! |
loadfilename 2! |
|
[ [ELSE] ] |
|
2drop |
[ [THEN] ] |
[ [THEN] ] |
-1 loadline ! #tib ! tib ! |
-1 loadline ! #tib ! tib ! |
r> catch pop-file throw ; |
r> catch pop-file throw ; |
|
|
|
: execute-parsing ( ... addr u xt -- ... ) \ gforth |
|
\G Make @i{addr u} the current input source, execute @i{xt @code{( |
|
\G ... -- ... )}}, then restore the previous input source. |
|
s" *evaluated string*" execute-parsing-wrapper ; |
|
|
: evaluate ( ... addr u -- ... ) \ core,block |
: evaluate ( ... addr u -- ... ) \ core,block |
\G Save the current input source specification. Store @code{-1} in |
\G Save the current input source specification. Store @code{-1} in |
\G @code{source-id} and @code{0} in @code{blk}. Set @code{>IN} to |
\G @code{source-id} and @code{0} in @code{blk}. Set @code{>IN} to |