feat(v4.0.0): the editor, redone in FORTH; COLD WARM PAGE VERSION DEFER
- capsule/editor.fth: the block editor as FORTH source, which the node compiles itself. It is a vocabulary, EDITOR, used at the ordinary prompt: n EDIT, then L N B T P E D S H R I WIPE DONE. v3's EDIT, a shell of its own, is not carried over (ruled 2026-10-05); v3's L S and SHOW are kept in FORTH as they were, with COPY. - system.v4: COLD (the system as the loader left it), WARM, PAGE, VERSION, 79-STANDARD (FORTH-79: silent), and DEFER IS DEFER@ as v3. - input.v4: where words are split at blanks a zero byte reads as a blank, so a block never written, or filled a line at a time, loads cleanly. - tests/test_host_quit.c: the editor's source fed to the prompt line by line, every command on empty and full screens, what reaches storage; the system words; deferred words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c8dc14897c
commit
a1afb44598
+9
-1
@@ -71,9 +71,17 @@ header QUERY
|
||||
\ (CONVERT and NUMBER use (P)+2 .. (P)+5; they and WORD never run inside
|
||||
\ each other.)
|
||||
|
||||
\ ( -- c ) the character WORD is at. A zero reads as a blank when words
|
||||
\ are being split at blanks: a block that has never been written is all
|
||||
\ zeros, and so is the end of one whose lines were put there one at a time.
|
||||
: (SRC@)
|
||||
(P)+6 a! @ (SRC) a! @ + C@ if Z ;
|
||||
Z: drop (P) a! @ -32 + if B drop 0 ;
|
||||
B: drop 32 ;
|
||||
|
||||
\ In line, not called: WORD may have only a few return entries to spare.
|
||||
macro (LEFT) (P)+6 a! @ (P)+1 a! @ - endmacro \ ( -- d ) d < 0 while inside the text
|
||||
macro (CH) (P)+6 a! @ (SRC) a! @ + C@ (P) a! @ xor endmacro \ ( -- x ) x = 0 at a delimiter
|
||||
macro (CH) (SRC@) (P) a! @ xor endmacro \ ( -- x ) x = 0 at a delimiter
|
||||
macro (STEP) (P)+6 a! @ 1 + ! endmacro
|
||||
|
||||
\ ( c -- baddr ) FORTH-79: characters are taken from TIB until the
|
||||
|
||||
Reference in New Issue
Block a user