Remove BROWSE and CASE

With the Visual Editor, BROWSE is of dubious value. Even before that,
it was of dubious value. It's the only user of the CASE word, which
is also of dubious value: too complicated for its own good.

The CMD pattern used in VE is much better.
This commit is contained in:
Virgil Dupras 2020-09-21 14:09:48 -04:00
parent fea9beac1e
commit 7a5744a4c3
8 changed files with 1 additions and 75 deletions

12
blk/100
View File

@ -3,14 +3,4 @@ Block editor
This is an application to conveniently browse the contents of
the disk blocks and edit them. You can load it with "105 LOAD".
Browse mode: If you execute BROWSE, the Forth interpreter is
replaced by browser's loop. Typing "Q" quits the browser.
In this mode, typing a decimal number followed by space or
return lists the contents of that block. B for previous block,
N for next.
When not in browse mode, your prompt is a regular Forth prompt
with editor words loaded.
(cont.)
See doc/ed.txt

16
blk/101
View File

@ -1,16 +0,0 @@
There are two buffers, IBUF (insert buffer) and FBUF (find
buffer). They are used as a typing target for the actions
described below. They both have a peculiar logic: when typing
is expected to fill a buffer, an empty value means "reuse
previous value". For example, typing "I foo I " inserts
"foofoo".
T ( n -- ): select line n for editing.
P xxx: put typed IBUF on selected line.
U xxx: insert typed IBUF on selected line.
F xxx: find typed FBUF in block, starting from current
position+1. If not found, don't move.
i xxx: insert typed IBUF at cursor. "i" is to avoid shadowing
core word "I".
Y: Copy n characters after cursor into IBUF, n being length of
FBUF. (cont.)

View File

@ -1,2 +0,0 @@
X ( n -- ): Delete X chars after cursor and place in IBUF.
E: Run X with n = length of FBUF.

12
blk/105
View File

@ -1,14 +1,2 @@
'? CASE NOT [IF] 48 49 LOADR+ [THEN] DROP ( B153-154 )
'? FILL NOT [IF] 50 LOAD+ [THEN] DROP ( B155 )
1 7 LOADR+
: BROWSE
0 ACC ! L
BEGIN
KEY CASE
'Q' OF EXIT ENDOF
'B' OF B ENDOF
'N' OF N ENDOF
_NUM
ENDCASE
AGAIN
;

View File

@ -1,3 +1,2 @@
'? CASE NOT [IF] 1 2 LOADR+ [THEN] DROP ( from '? )
'? FILL NOT [IF] 3 LOAD+ [THEN] DROP
'? WIPE NOT [IF] 5 LOAD+ [THEN] DROP

View File

@ -1,9 +0,0 @@
( During a CASE, the stack grows by 1 at each ENDOF so that
we can fill all those ENDOF branching addrs. So that we
know when to stop, we put a 0 on PSP. That's our stopgap. )
: CASE 0 ; IMMEDIATE
: OF
COMPILE OVER COMPILE =
[COMPILE] IF COMPILE DROP
; IMMEDIATE
: ENDOF [COMPILE] ELSE ; IMMEDIATE

View File

@ -1,9 +0,0 @@
( At this point, we have something like "0 e1 e2 e3 val". We
want to drop val, and then call THEN as long as we don't
hit 0. )
: ENDCASE
BEGIN
?DUP NOT IF EXIT THEN
[COMPILE] THEN
AGAIN
; IMMEDIATE

View File

@ -1,15 +0,0 @@
152 LOAD ( extra )
: foo
CASE
'X' OF 42 ENDOF
0x12 OF 43 ENDOF
255 OF 44 ENDOF
1+
ENDCASE
;
'X' foo 42 #eq
0x12 foo 43 #eq
255 foo 44 #eq
254 foo 255 #eq
'S S0 #eq