--- gforth/assert.fs 1999/03/23 20:24:16 1.8 +++ gforth/assert.fs 2002/12/04 16:56:31 1.11 @@ -1,6 +1,6 @@ \ assertions -\ Copyright (C) 1995,1996,1997 Free Software Foundation, Inc. +\ Copyright (C) 1995,1996,1997,1999 Free Software Foundation, Inc. \ This file is part of Gforth. @@ -16,7 +16,7 @@ \ You should have received a copy of the GNU General Public License \ along with this program; if not, write to the Free Software -\ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +\ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. require source.fs @@ -48,15 +48,14 @@ variable assert-level ( -- a-addr ) \ gf \G Equivalent to @code{assert1(} POSTPONE assert1( ; immediate -: (endassert) ( flag -- ) \ gforth-internal - \ inline argument sourcepos - if - r> sourcepos %size + >r EXIT +: (end-assert) ( flag nfile nline -- ) \ gforth-internal + rot if + 2drop else - r> print-sourcepos ." : failed assertion" + .sourcepos ." : failed assertion" true abort" assertion failed" \ !! or use a new throw code? then ; : ) ( -- ) \ gforth close-paren - \G End an assertion. - POSTPONE (endassert) sourcepos, ; immediate +\G End an assertion. + compile-sourcepos POSTPONE (end-assert) ; immediate