[gforth] / gforth / except.fs  

gforth: gforth/except.fs

Diff for /gforth/except.fs between version 1.21 and 1.22

version 1.21, Mon Dec 31 18:40:24 2007 UTC version 1.22, Tue Aug 31 20:10:59 2010 UTC
Line 75 
Line 75 
     \G backtrace.      \G backtrace.
     first-throw on ;      first-throw on ;
   
   : (try0) ( -- aoldhandler )
       first-throw on
       handler @ ;
   
   [undefined] (try1) [if]
   : (try1) ( aoldhandler arecovery -- anewhandler )
       r>
       swap >r \ recovery address
       sp@ cell+ >r
       fp@ >r
       lp@ >r
       swap >r \ old handler
       rp@ swap \ new handler
       >r ;
   [endif]
   
   : (try2)
       handler ! ;
   
 : (try) ( ahandler -- )  : (try) ( ahandler -- )
     first-throw on      first-throw on
     r>      r>
Line 86 
Line 105 
     rp@ handler !      rp@ handler !
     >r ;      >r ;
   
   \ : try ( compilation  -- orig ; run-time  -- R:sys1 ) \ gforth
   \     \G Start an exception-catching region.
   \     POSTPONE ahead here >r >mark 1 cs-roll POSTPONE then
   \     r> POSTPONE literal POSTPONE (try) ; immediate compile-only
   
 : try ( compilation  -- orig ; run-time  -- R:sys1 ) \ gforth  : try ( compilation  -- orig ; run-time  -- R:sys1 ) \ gforth
     \G Start an exception-catching region.      \G Start an exception-catching region.
     POSTPONE ahead here >r >mark 1 cs-roll POSTPONE then      POSTPONE ahead here >r >mark 1 cs-roll POSTPONE then
     r> POSTPONE literal POSTPONE (try) ; immediate compile-only      POSTPONE (try0) r> POSTPONE literal POSTPONE (try1) POSTPONE (try2)
   ; immediate compile-only
   
   
 : (endtry) ( -- )  : (endtry) ( -- )
     \ normal end of try block: restore handler, forget rest      \ normal end of try block: restore handler, forget rest


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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help