kolibrios/programs/develop/SPForth/devel/~mak/CompIF.f
Kirill Lipatov (Leency) 09488af869 KolSPForth12 uploaded to SVN
git-svn-id: svn://kolibrios.org@4867 a494cfbc-eb01-0410-851d-a64ba20cac60
2014-04-21 19:22:58 +00:00

26 lines
670 B
Forth

: [ELSE]
1
BEGIN
NextWord DUP
IF
2DUP S" [IF]" COMPARE 0= IF 2DROP 1+ ELSE
2DUP S" [ELSE]" COMPARE 0= IF 2DROP 1- DUP IF 1+ THEN ELSE
S" [THEN]" COMPARE 0= IF 1- THEN
THEN THEN
ELSE 2DROP REFILL AND \ SOURCE TYPE
THEN DUP 0=
UNTIL DROP ; IMMEDIATE
: [IF] 0= IF [COMPILE] [ELSE] THEN ; IMMEDIATE
: [THEN] ; IMMEDIATE
C" \S" FIND NIP 0=
[IF]
: \S \ comment to end of file
SOURCE-ID FILE-SIZE DROP
SOURCE-ID REPOSITION-FILE DROP
[COMPILE] \ ; IMMEDIATE
[THEN]