kolibrios-gitea/programs/develop/SPForth/devel/~mak/case.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

34 lines
580 B
Forth

VARIABLE CSP \ Óêàçàòåëü ñòåêà êîíòðîëÿ
: CASE
CSP @ SP@ CSP ! ; IMMEDIATE
: ?OF_
POSTPONE IF POSTPONE DROP ; IMMEDIATE
: OF
POSTPONE OVER POSTPONE = POSTPONE ?OF_ ; IMMEDIATE
: ENDOF
POSTPONE ELSE ; IMMEDIATE
: DUPENDCASE
BEGIN SP@ CSP @ <> WHILE POSTPONE THEN REPEAT
CSP ! ; IMMEDIATE
: ENDCASE
POSTPONE DROP POSTPONE DUPENDCASE
; IMMEDIATE
: OF\
POSTPONE OVER POSTPONE <> POSTPONE IF ; IMMEDIATE
: OF;
POSTPONE OVER POSTPONE = POSTPONE IF 2>R
POSTPONE DUPENDCASE 2R>
POSTPONE DROP ; IMMEDIATE
HEX