Diff for /gforth/kernel/input.fs between versions 1.4 and 1.5

version 1.4, 2003/01/19 23:35:34 version 1.5, 2003/01/20 19:17:59
Line 81  cell input-var blk \ block Line 81  cell input-var blk \ block
 cell input-var #fill-bytes \ gforth  cell input-var #fill-bytes \ gforth
     \G @code{input-var} variable -- number of bytes read via      \G @code{input-var} variable -- number of bytes read via
     \G (read-line) by the last refill      \G (read-line) by the last refill
 cell input-var loadfilename# \ gforth  2 cells input-var loadfilename \ gforth
     \G @code{input-var} variable -- This cell contains the index into      \G @code{input-var} variable -- addr u describes name of currently
     \G the file name array and allows to identify the loaded file.      \G interpreted input (file name or somesuch)
 [THEN]  [THEN]
 0 input-var tib  0 input-var tib
   
Line 191  has? file [IF] Line 191  has? file [IF]
 : create-input ( -- )  : create-input ( -- )
     \G create a new terminal input      \G create a new terminal input
     terminal-input def#tib new-tib ;      terminal-input def#tib new-tib ;
     ( loadfilename# off ) \ "*the terminal*"      \ s" *the terminal*" loadfilename 2!
   
 : 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
Line 201  has? file [IF] Line 201  has? file [IF]
     \G restore the input source specification.      \G restore the input source specification.
     evaluate-input cell new-tib      evaluate-input cell new-tib
 [ has? file [IF] ]  [ has? file [IF] ]
     1 loadfilename# ! \ "*evaluated string*"      s" *evaluated string*" loadfilename 2!
 [ [THEN] ]  [ [THEN] ]
     -1 loadline ! #tib ! tib !      -1 loadline ! #tib ! tib !
     ['] interpret catch pop-file throw ;      ['] interpret catch pop-file throw ;
Line 227  has? file [IF] Line 227  has? file [IF]
     \G refill and interpret a file until EOF      \G refill and interpret a file until EOF
     BEGIN  refill  WHILE  interpret  REPEAT ;      BEGIN  refill  WHILE  interpret  REPEAT ;
   
 : include-file2 ( i*x wfileid loadfilename# -- j*x )  : include-file2 ( i*x wfileid filename-addr filename-u -- j*x )
     push-file \ dup 2* cells included-files 2@ drop + 2@ type      push-file \ dup 2* cells included-files 2@ drop + 2@ type
     loadfilename# !  loadfile !      loadfilename 2!  loadfile !
     ['] read-loop catch      ['] read-loop catch
     loadfile @ close-file swap 2dup or      loadfile @ close-file swap 2dup or
     pop-file  drop throw throw ;      pop-file  drop throw throw ;
Line 237  has? file [IF] Line 237  has? file [IF]
 : include-file ( i*x wfileid -- j*x )  : include-file ( i*x wfileid -- j*x )
     \G Interpret (process using the text interpreter) the contents of      \G Interpret (process using the text interpreter) the contents of
     \G the file @var{wfileid}.      \G the file @var{wfileid}.
     3 include-file2 ;      s" * a file*" include-file2 ;
 [THEN]  [THEN]

Removed from v.1.4  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>