diff options
Diffstat (limited to 'core.fth')
-rw-r--r-- | core.fth | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,8 +1,7 @@ -: ['] ' postpone literal ; immediate - -\ : postpone _parse _get -\ dup cell+ @ 256 and if -\ >xt , else ['] _lit , >xt , ['] , , then ; immediate +: literal [ ' _lit dup , , ] , , ; immediate +: ['] ' [ ' literal , ] ; immediate +: postpone _parse _get dup cell+ @ 256 and if + >xt , else ['] _lit , >xt , ['] , , then ; immediate : _msb [ 1 cell 8 * 1- lshift ] literal ; : 2/ dup 1 rshift swap 0< if _msb or then ; @@ -17,13 +16,13 @@ : repeat _jmp , , if postpone then then ; immediate : until _jmp0 , , drop ; immediate -: do ['] literal , here 0 , ['] >r , postpone 2>r here ; immediate +: do ['] _lit , here 0 , ['] >r , postpone 2>r here ; immediate : unloop postpone 2r> ['] 2drop , ['] r> , ['] drop , ; immediate : leave postpone 2r> ['] 2drop , postpone exit ; immediate : +loop ['] r> , ['] 2dup , ['] + , postpone r@ ['] swap , ['] >r , ['] - , ['] 2dup , ['] + , ['] over , ['] xor , - ['] rot , ['] rot , ['] xor , ['] and , ['] literal , 0 , + ['] rot , ['] rot , ['] xor , ['] and , ['] _lit , 0 , ['] < , _jmp0 , , postpone unloop here 1 cells - swap ! ; immediate : loop postpone 2r> ['] 1+ , ['] 2dup , @@ -48,6 +47,7 @@ : space bl emit ; : spaces begin dup 0 > while space 1- repeat drop ; +: key >in @ 0< if 0 else tib @ >in @ + c@ 1 >in +! then ; : word 0 here c! begin \ bl key 2dup <> \ bl key <> over 0<> and while \ bl key |