From 0ebff7e4fddf0e7f95a22f4082fe53bc74dedf31 Mon Sep 17 00:00:00 2001 From: dcs Date: Thu, 4 Feb 1999 12:57:56 +0000 Subject: Add conditional compilation facilities to ficl. This had been previously committed to RELENG_3 instead of HEAD, so let's HEAD catch up. PR: bin/9662 --- sys/boot/ficl/softwords/softcore.fr | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'sys/boot/ficl') diff --git a/sys/boot/ficl/softwords/softcore.fr b/sys/boot/ficl/softwords/softcore.fr index 2b11142..b57416b 100644 --- a/sys/boot/ficl/softwords/softcore.fr +++ b/sys/boot/ficl/softwords/softcore.fr @@ -78,6 +78,38 @@ decimal 32 constant bl loop drop ; +\ ** Some TOOLS EXT words, straight from the standard +: [else] ( -- ) + 1 begin \ level + begin + bl word count dup while \ level adr len + 2dup s" [IF]" compare 0= >r + 2dup s" [if]" compare 0= r> or + if \ level adr len + 2drop 1+ \ level' + else \ level adr len + 2dup s" [ELSE]" compare 0= >r + 2dup s" [else]" compare 0= r> or + if \ level adr len + 2drop 1- dup if 1+ then \ level' + else \ level adr len + 2dup + s" [THEN]" compare 0= >r \ level adr len + s" [then]" compare 0= r> or + if \ level + 1- \ level' + then + then + then ?dup 0= if exit then \ level' + repeat 2drop \ level + refill 0= until \ level + drop +; immediate + +: [if] ( flag -- ) +0= if postpone [else] then ; immediate + +: [then] ( -- ) ; immediate \ ** SEARCH+EXT words and ficl helpers \ : wordlist ( -- ) -- cgit v1.1