summaryrefslogtreecommitdiffstats
path: root/sys/boot/ficl
diff options
context:
space:
mode:
authordcs <dcs@FreeBSD.org>1999-02-04 12:57:56 +0000
committerdcs <dcs@FreeBSD.org>1999-02-04 12:57:56 +0000
commit0ebff7e4fddf0e7f95a22f4082fe53bc74dedf31 (patch)
treee430879dc2c6f909de7a3e5501c96a50e55b97d8 /sys/boot/ficl
parent69d836b175c2592919e2b018065242f135bd266f (diff)
downloadFreeBSD-src-0ebff7e4fddf0e7f95a22f4082fe53bc74dedf31.zip
FreeBSD-src-0ebff7e4fddf0e7f95a22f4082fe53bc74dedf31.tar.gz
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
Diffstat (limited to 'sys/boot/ficl')
-rw-r--r--sys/boot/ficl/softwords/softcore.fr32
1 files changed, 32 insertions, 0 deletions
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 ( -- )
OpenPOWER on IntegriCloud