--- gforth/kernel/cond.fs 2000/06/17 12:01:55 1.8 +++ gforth/kernel/cond.fs 2011/12/31 15:29:26 1.26 @@ -1,12 +1,12 @@ \ Structural Conditionals 12dec92py -\ Copyright (C) 1995,1996,1997 Free Software Foundation, Inc. +\ Copyright (C) 1995,1996,1997,2000,2003,2004,2007,2010,2011 Free Software Foundation, Inc. \ This file is part of Gforth. \ Gforth is free software; you can redistribute it and/or \ modify it under the terms of the GNU General Public License -\ as published by the Free Software Foundation; either version 2 +\ as published by the Free Software Foundation, either version 3 \ of the License, or (at your option) any later version. \ This program is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ \ GNU General Public License for more details. \ 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. +\ along with this program. If not, see http://www.gnu.org/licenses/. here 0 , \ just a dummy, the real value of locals-list is patched into it in glocals.fs AConstant locals-list \ acts like a variable that contains @@ -92,6 +91,9 @@ variable backedge-locals rdrop dup cs-item? ; +: CS-DROP ( dest -- ) \ gforth + dest? 2drop ; + : cs-push-part ( -- list addr ) locals-list @ here ; @@ -105,12 +107,17 @@ variable backedge-locals \ Structural Conditionals 12dec92py +defer other-control-flow ( -- ) +\ hook for control-flow stuff that's not handled by begin-like etc. + : ?struc ( flag -- ) abort" unstructured " ; : sys? ( sys -- ) dup 0= ?struc ; : >mark ( -- orig ) - cs-push-orig 0 , ; -: >resolve ( addr -- ) here over - swap ! ; -: resolve ( addr -- ) + here swap ! + basic-block-end ; +: r drop begin leave> @@ -299,12 +307,13 @@ Defer exit-like ( -- ) ' noop IS exit-like : EXIT ( compilation -- ; run-time nest-sys -- ) \ core - \G Return to the calling definition; usually used as a way of - \G forcing an early return from a definition. Before - \G @code{EXIT}ing you must clean up the return stack and - \G @code{UNLOOP} any outstanding @code{?DO}...@code{LOOP}s. +\G Return to the calling definition; usually used as a way of +\G forcing an early return from a definition. Before +\G @code{EXIT}ing you must clean up the return stack and +\G @code{UNLOOP} any outstanding @code{?DO}...@code{LOOP}s. exit-like POSTPONE ;s + basic-block-end POSTPONE unreachable ; immediate restrict : ?EXIT ( -- ) ( compilation -- ; run-time nest-sys f -- | nest-sys ) \ gforth