diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-05-22 00:29:03 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-05-22 00:29:03 -0700 |
| commit | ed702c3b88953112a3682c818a6e801549e1b461 (patch) | |
| tree | f53e5e9c1ac40250552ba0f9cb6e627cd8caeb9e /interpret.e | |
| parent | 5ae0fdad3c7df2fc02acfc3b8f36d96c5d07bcd4 (diff) | |
it runs!!!!!! it interactively reads input and everything
only some of that actually works, but hey, it's a start Force-Push: yes Change-Id: Ib82beb695be1a18de8aaaf3040b7c632851c6002
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 |