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
This commit is contained in:
parent
0f1110bb5f
commit
aa8b85772f
@ -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 ( -- )
|
||||
|
Loading…
Reference in New Issue
Block a user