diff options
Diffstat (limited to 'core.fth')
-rw-r--r-- | core.fth | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -1,4 +1,4 @@ -: ['] ' [ ' literal , ] ; immediate +: ['] ' postpone literal ; immediate : if ['] _jmp0 , here 0 , ; immediate : then here swap ! ; immediate @@ -59,14 +59,16 @@ dup here c! \ bl key u here + c! \ bl repeat 2drop here ; -: count dup char+ swap c@ ; -: char 0 here char+ c! bl word char+ c@ ; -: [char] char postpone literal ; immediate +: count dup char+ swap c@ ; +: char 0 here char+ c! bl word char+ c@ ; +: [char] char postpone literal ; immediate -: s" state @ if ['] _jmp , here 0 , then - [char] " word count - state @ 0= if exit then - dup cell+ allot - rot here swap ! - swap postpone literal postpone literal ; immediate +: s" state @ if ['] _jmp , here 0 , then + [char] " word count + state @ 0<> if + dup cell+ allot + rot here swap ! + swap postpone literal postpone literal then ; immediate + +: ( begin [char] ) key = until ; immediate |