Diff for /gforth/prims2x.fs between versions 1.129 and 1.130

version 1.129, 2003/01/20 17:07:38 version 1.130, 2003/01/30 16:14:31
Line 1328  print-token ! Line 1328  print-token !
  getinput member? ;   getinput member? ;
 ' testchar? test-vector !  ' testchar? test-vector !
   
 : checksyncline ( -- )  : checksynclines ( -- )
     \ when input points to a newline, check if the next line is a      \ when input points to a newline, check if the next line is a
     \ sync line.  If it is, perform the appropriate actions.      \ sync line.  If it is, perform the appropriate actions.
     rawinput @ >r      begin
     s" #line " r@ over compare if          rawinput @ >r
         rdrop 1 line +! EXIT          s" #line " r@ over compare if
     endif              rdrop 1 line +! EXIT
     0. r> 6 chars + 20 >number drop >r drop line ! r> ( c-addr )          endif
     dup c@ bl = if          0. r> 6 chars + 20 >number drop >r drop line ! r> ( c-addr )
         char+ dup c@ [char] " <> 0= s" sync line syntax" ?print-error          dup c@ bl = if
         char+ dup 100 [char] " scan drop swap 2dup - save-mem filename 2!              char+ dup c@ [char] " <> 0= s" sync line syntax" ?print-error
         char+              char+ dup 100 [char] " scan drop swap 2dup - save-mem filename 2!
     endif              char+
     dup c@ nl-char <> 0= s" sync line syntax" ?print-error          endif
     skipsynclines @ if          dup c@ nl-char <> 0= s" sync line syntax" ?print-error
         dup char+ rawinput !          skipsynclines @ if
         rawinput @ c@ cookedinput @ c!              dup char+ rawinput !
     endif              rawinput @ c@ cookedinput @ c!
     drop ;          endif
           drop
       again ;
   
 : ?nextchar ( f -- )  : ?nextchar ( f -- )
     s" syntax error, wrong char" ?print-error      s" syntax error, wrong char" ?print-error
Line 1355  print-token ! Line 1357  print-token !
         1 chars rawinput +!          1 chars rawinput +!
         1 chars cookedinput +!          1 chars cookedinput +!
         nl-char = if          nl-char = if
             checksyncline              checksynclines
             rawinput @ line-start !              rawinput @ line-start !
         endif          endif
         rawinput @ c@ cookedinput @ c!          rawinput @ c@
           cookedinput @ c!
     endif ;      endif ;
   
 : charclass ( set "name" -- )  : charclass ( set "name" -- )
Line 1503  warnings @ [IF] Line 1506  warnings @ [IF]
     \ process the string at addr u      \ process the string at addr u
     over dup rawinput ! dup line-start ! cookedinput !      over dup rawinput ! dup line-start ! cookedinput !
     + endrawinput !      + endrawinput !
     checksyncline      checksynclines
     primitives2something ;          primitives2something ;    
   
   : unixify ( c-addr u1 -- c-addr u2 )
       \ delete crs from the string
       bounds tuck tuck ?do ( c-addr1 )
           i c@ dup #cr <> if
               over c! char+
           else
               drop
           endif
       loop
       over - ;
   
 : process-file ( addr u xt-simple x-combined -- )  : process-file ( addr u xt-simple x-combined -- )
     output-combined ! output !      output-combined ! output !
     save-mem 2dup filename 2!      save-mem 2dup filename 2!
     slurp-file      slurp-file unixify
     warnings @ if      warnings @ if
         ." ------------ CUT HERE -------------" cr  endif          ." ------------ CUT HERE -------------" cr  endif
     primfilter ;      primfilter ;

Removed from v.1.129  
changed lines
  Added in v.1.130


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