diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-03-04 09:51:08 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-03-04 09:51:08 -0500 |
commit | a529c1591826c120703afd7b88b245f7f659214c (patch) | |
tree | db0992c7afc3356a0fbf64e616a1f3e25199e443 /core.fth | |
parent | 18a4c6111f3cff40bcd81f3b91aeb34a8fab6bbc (diff) |
add case/endcase of/endof
Diffstat (limited to 'core.fth')
-rw-r--r-- | core.fth | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -236,3 +236,9 @@ : evaluate _source @ >r _sourceu @ >r >in @ >r 0 >in ! _sourceu ! _source ! 5 sys r> >in ! r> _sourceu ! r> _source ! ; + +: case ['] _lit , 1 here 0 , ['] drop , ; imm +: of ['] over , ['] = , postpone if ; imm +: endof ['] _jmp , here >r 0 , postpone then + swap 1+ swap r> tuck ! ; imm +: endcase swap 0 do dup @ swap here swap ! loop drop ['] drop , ; imm |