Diff for /gforth/prims2x.fs between versions 1.64 and 1.65

version 1.64, 2001/01/17 09:35:12 version 1.65, 2001/01/18 14:57:37
Line 68  variable rawinput \ pointer to next char Line 68  variable rawinput \ pointer to next char
 variable endrawinput \ pointer to the end of the input (the char after the last)  variable endrawinput \ pointer to the end of the input (the char after the last)
 variable cookedinput \ pointer to the next char to be parsed  variable cookedinput \ pointer to the next char to be parsed
 variable line \ line number of char pointed to by input  variable line \ line number of char pointed to by input
 1 line !  variable line-start \ pointer to start of current line (for error messages)
   0 line !
 2variable filename \ filename of original input file  2variable filename \ filename of original input file
 0 0 filename 2!  0 0 filename 2!
 2variable f-comment  2variable f-comment
Line 225  print-token ! Line 226  print-token !
     endif      endif
     drop ;      drop ;
   
   : print-error-line ( -- )
       \ print the current line and position
       line-start @ endrawinput @ over - 2dup nl-char scan drop nip ( start end )
       over - type cr
       line-start @ rawinput @ over - typewhite ." ^" cr ;
       
 : ?nextchar ( f -- )  : ?nextchar ( f -- )
     ?not? if      ?not? if
         filename 2@ type ." :" line @ 0 .r ." : syntax error, wrong char:"          outfile-id >r try
         getinput . cr              stderr to outfile-id
         rawinput @ endrawinput @ over - 100 min type cr              filename 2@ type ." :" line @ 0 .r ." : syntax error, wrong char:"
               getinput . cr
               print-error-line
               0
           recover endtry
           r> to outfile-id throw
         abort          abort
     endif      endif
     rawinput @ endrawinput @ <> if      rawinput @ endrawinput @ <> if
Line 238  print-token ! Line 250  print-token !
         1 chars cookedinput +!          1 chars cookedinput +!
         nl-char = if          nl-char = if
             checksyncline              checksyncline
               rawinput @ line-start !
         endif          endif
         rawinput @ c@ cookedinput @ c!          rawinput @ c@ cookedinput @ c!
     endif ;      endif ;
Line 349  warnings @ [IF] Line 362  warnings @ [IF]
 : primfilter ( file-id xt -- )  : primfilter ( file-id xt -- )
 \ fileid is for the input file, xt ( -- ) is for the output word  \ fileid is for the input file, xt ( -- ) is for the output word
  output !   output !
  here dup rawinput ! cookedinput !   here dup rawinput ! dup line-start ! cookedinput !
  here unused rot read-file throw   here unused rot read-file throw
  dup here + endrawinput !   dup here + endrawinput !
  allot   allot

Removed from v.1.64  
changed lines
  Added in v.1.65


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