~crc_/retroforth

6fa38ed966088f706eb00355a8397797f13679f5 — crc 15 days ago 00441eb master
fix a couple of things in example/alternate-listener.retro

FossilOrigin-Name: b3cb321551d24e23a3a1cb34bc708ac183a96cf2767fa8d8c8f51242d9233a5e
1 files changed, 1 insertions(+), 16 deletions(-)

M example/alternate-listener.retro
M example/alternate-listener.retro => example/alternate-listener.retro +1 -16
@@ 31,21 31,6 @@ and providing a more flexible base to build on.

# The Code

The RETRO image has a 512 cell buffer between the kernel and the
high level code. This is used for the Text Input Buffer, or TIB.

    +------------------+
    | kernel           | 0-1023
    | input buffer     | 1024-1536
    | standard library | 1537+
    | ...              |
    | system buffers   | EOM - ???
    +------------------+

~~~
#1024 'TIB const
~~~

The listener needs to determine what to treat as the end of the
token. I define `end-of-token?` for this.



@@ 124,7 109,7 @@ And with these, I can quickly implement the `new-listener`.
~~~
{{
  :guard   (-)  buffer:end TIB lt? [ TIB buffer:set ] if ;
  :c:get   (-c) as{ 'liii.... i #1 d }as dup buffer:add ;
  :c:get   (-c) \liii.... `1 dup buffer:add ;
  :s:get   (-s) [ TIB buffer:set
                  [ guard c:get special-keys check end-of-token? ] until
                  buffer:start s:chop ] buffer:preserve ;