diff options
Diffstat (limited to 'interpret.e')
| -rw-r--r-- | interpret.e | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/interpret.e b/interpret.e index 516c728..3e30523 100644 --- a/interpret.e +++ b/interpret.e @@ -450,27 +450,6 @@ latest @ ; make-immediate -~ Though we only do it once, this is a bit involved so we provide it as a -~ word. Notionally there are situations in which it could come up again, so -~ it seems worth having around. -~ -~ It actually needs to run as a compiled word no matter what; if it were -~ run in interpret mode it would cut itself off from the rest of itself. -~ However, if we didn't want to keep it around we could have it forget -~ itself... -~ -~ It depends on ', so it's here in interpret.e. -: relink-main-input-buffer-to-stdin - 1024 allocate dup main-input-buffer buffer-physical-start ! - main-input-buffer buffer-logical-start ! - 1024 main-input-buffer buffer-physical-length ! - 0 main-input-buffer buffer-logical-length ! - ' refill-input-buffer-from-stdin entry-to-execution-token - main-input-buffer input-buffer-refill ! - ; - - - ~ Now the single most important word... : interpret word @@ -536,5 +515,27 @@ dup entry-flags@ 0x80 invert & entry-flags! dup entry-flags@ 0x80 invert & entry-flags! dup entry-flags@ 0x80 invert & entry-flags! -relink-main-input-buffer-to-stdin quit +~ Though we only do it once, this is a bit involved so we provide it as a +~ word. Notionally there are situations in which it could come up again, so +~ it seems worth having around. +~ +~ It actually needs to run as a compiled word no matter what; if it were +~ run in interpret mode it would cut itself off from the rest of itself. +~ However, if we didn't want to keep it around we could have it forget +~ itself... +~ +~ It depends on ', so it's here in interpret.e. +: relink-main-input-buffer-to-stdin + 1024 allocate dup main-input-buffer buffer-physical-start ! + main-input-buffer buffer-logical-start ! + 1024 main-input-buffer buffer-physical-length ! + 0 main-input-buffer buffer-logical-length ! + [ s" refill-input-buffer-from-stdin" + find entry-to-execution-token literal ] + main-input-buffer input-buffer-refill ! + ; + +~ Of course it is perfectly reasonable to change this, but for now it's +~ hardcoded. +relink-main-input-buffer-to-stdin |