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

version 1.3, 2003/01/01 17:28:30 version 1.4, 2003/01/19 23:35:34
Line 26  DOES> ( ... -- ... ) @ current-input @ @ Line 26  DOES> ( ... -- ... ) @ current-input @ @
 DOES> ( -- addr ) @ current-input @ + ;  DOES> ( -- addr ) @ current-input @ + ;
   
 0  0
 input-method source ( -- 0 | -1 | fileid ) \ core-ext,file source-i-d  input-method source ( -- addr u ) \ core-ext,file source
     \G Return 0 (the input source is the user input device), -1 (the      \G Return address @i{addr} and length @i{u} of the current input
     \G input source is a string being processed by @code{evaluate}) or      \G buffer
     \G a @i{fileid} (the input source is the file specified by  
     \G @i{fileid}).  
 input-method refill ( -- flag ) \ core-ext,block-ext,file-ext  input-method refill ( -- flag ) \ core-ext,block-ext,file-ext
     \G Attempt to fill the input buffer from the input source.  When      \G Attempt to fill the input buffer from the input source.  When
     \G the input source is the user input device, attempt to receive      \G the input source is the user input device, attempt to receive
Line 93  Constant tib+ Line 91  Constant tib+
   
 \ terminal input implementation  \ terminal input implementation
   
 :noname  1 <> -12 and throw >in ! ;  :noname ( in 1 -- ) 1 <> -12 and throw >in ! ;
                        \ restore-input                         \ restore-input
 :noname  >in @ 1 ;     \ save-input  :noname ( -- in 1 ) >in @ 1 ;     \ save-input
 ' false                \ source-id  ' false                \ source-id
 :noname [ has? file [IF] ]   :noname ( -- flag ) [ has? file [IF] ] 
     stdin file-eof?  IF  false  EXIT  THEN [ [THEN] ]      stdin file-eof?  IF  false  EXIT  THEN [ [THEN] ]
     tib max#tib @ accept #tib !      tib max#tib @ accept #tib !
     >in off true 1 loadline +! ;     \ refill      >in off true 1 loadline +! ;     \ refill
 :noname  tib #tib @ ;  \ source  :noname ( -- addr u ) tib #tib @ ;   \ source
   
 | Create terminal-input   A, A, A, A, A,  | Create terminal-input   A, A, A, A, A,
 :noname  tib @ #tib @ ; \ source  :noname ( -- addr u ) tib @ #tib @ ; \ source
 | Create evaluate-input  | Create evaluate-input
     A,                  \ source      A,                  \ source
     ' false A,          \ refill      ' false A,          \ refill
Line 117  Constant tib+ Line 115  Constant tib+
 has? file [IF]  has? file [IF]
 : read-line ( c_addr u1 wfileid -- u2 flag wior ) (read-line) nip ;  : read-line ( c_addr u1 wfileid -- u2 flag wior ) (read-line) nip ;
   
 :noname  4 <> -12 and throw  :noname  ( in line# udpos 4 -- ) 4 <> -12 and throw
     loadfile @ reposition-file throw      loadfile @ reposition-file throw
     refill 0= -36 and throw \ should never throw      refill 0= -36 and throw \ should never throw
     loadline ! >in ! ; \ restore-input      loadline ! >in ! ; \ restore-input
 :noname  >in @ sourceline#  :noname  ( -- in line# udpos 4 ) >in @ sourceline#
     loadfile @ file-position throw #fill-bytes @ 0 d-      loadfile @ file-position throw #fill-bytes @ 0 d-
     4 ;                \ save-input      4 ;                \ save-input
 :noname  loadfile @ ;  \ source-id  :noname  ( -- file ) loadfile @ ;  \ source-id
 :noname  #tib off #fill-bytes off >in off  :noname  ( -- flag )
       #tib off #fill-bytes off >in off
     BEGIN      BEGIN
         tib max#tib @ #tib @ /string          tib max#tib @ #tib @ /string
         loadfile @ (read-line) throw #fill-bytes +!          loadfile @ (read-line) throw #fill-bytes +!

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


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