From 7a5744a4c3747bad50efe19c0083bc2dce4b9e7e Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 21 Sep 2020 14:09:48 -0400 Subject: [PATCH] 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. --- blk/100 | 12 +----------- blk/101 | 16 ---------------- blk/102 | 2 -- blk/105 | 12 ------------ blk/152 | 1 - blk/153 | 9 --------- blk/154 | 9 --------- tests/cvm/test_flow.fs | 15 --------------- 8 files changed, 1 insertion(+), 75 deletions(-) delete mode 100644 blk/101 delete mode 100644 blk/102 delete mode 100644 blk/153 delete mode 100644 blk/154 delete mode 100644 tests/cvm/test_flow.fs diff --git a/blk/100 b/blk/100 index d234f82..79ecb65 100644 --- a/blk/100 +++ b/blk/100 @@ -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 diff --git a/blk/101 b/blk/101 deleted file mode 100644 index f6e4b9e..0000000 --- a/blk/101 +++ /dev/null @@ -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.) diff --git a/blk/102 b/blk/102 deleted file mode 100644 index e2622bc..0000000 --- a/blk/102 +++ /dev/null @@ -1,2 +0,0 @@ -X ( n -- ): Delete X chars after cursor and place in IBUF. -E: Run X with n = length of FBUF. diff --git a/blk/105 b/blk/105 index 66a36ac..8f090be 100644 --- a/blk/105 +++ b/blk/105 @@ -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 -; diff --git a/blk/152 b/blk/152 index 6835f85..4b648e9 100644 --- a/blk/152 +++ b/blk/152 @@ -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 diff --git a/blk/153 b/blk/153 deleted file mode 100644 index f8d8952..0000000 --- a/blk/153 +++ /dev/null @@ -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 diff --git a/blk/154 b/blk/154 deleted file mode 100644 index 5e994a0..0000000 --- a/blk/154 +++ /dev/null @@ -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 diff --git a/tests/cvm/test_flow.fs b/tests/cvm/test_flow.fs deleted file mode 100644 index 78feb46..0000000 --- a/tests/cvm/test_flow.fs +++ /dev/null @@ -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