[gforth] / gforth / prims2x.fs  

gforth: gforth/prims2x.fs

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

version 1.64, Wed Jan 17 09:35:12 2001 UTC version 1.65, Thu Jan 18 14:57:37 2001 UTC
Line 68 
Line 68 
 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 
Line 226 
     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
           outfile-id >r try
               stderr to outfile-id
         filename 2@ type ." :" line @ 0 .r ." : syntax error, wrong char:"          filename 2@ type ." :" line @ 0 .r ." : syntax error, wrong char:"
         getinput . cr          getinput . cr
         rawinput @ endrawinput @ over - 100 min type cr              print-error-line
               0
           recover endtry
           r> to outfile-id throw
         abort          abort
     endif      endif
     rawinput @ endrawinput @ <> if      rawinput @ endrawinput @ <> if
Line 238 
Line 250 
         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 
Line 362 
 : 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


Generate output suitable for use with a patch program
Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help