Moved block editor into its own vocabulary.
This commit is contained in:
@ -41,16 +41,21 @@ forth definitions internals
|
||||
: load ( n -- ) block 1024 evaluate ;
|
||||
: thru ( a b -- ) over - 1+ for aft dup >r load r> 1+ then next drop ;
|
||||
|
||||
( Utility )
|
||||
: copy ( from to -- )
|
||||
swap block pad 1024 cmove pad swap block 1024 cmove update ;
|
||||
|
||||
( Editing )
|
||||
: list ( n -- ) scr ! ." Block " scr @ . cr scr @ block
|
||||
15 for dup 63 type [char] | emit space 15 r@ - . cr 64 + next drop ;
|
||||
: l scr @ list ; : n 1 scr +! l ; : p -1 scr +! l ;
|
||||
internals definitions
|
||||
: @line ( n -- ) 64 * scr @ block + ;
|
||||
: e' ( n -- ) @line clobber-line drop update ;
|
||||
forth definitions internals
|
||||
vocabulary editor also editor definitions
|
||||
: l scr @ list ; : n 1 scr +! l ; : p -1 scr +! l ;
|
||||
: wipe 15 for r@ e' next l ; : e e' l ;
|
||||
: d ( n -- ) dup 1+ @line swap @line 15 @line over - cmove 15 e ;
|
||||
: r ( n "line" -- ) 0 parse 64 min rot dup e @line swap cmove l ;
|
||||
: a ( n "line" -- ) dup @line over 1+ @line 16 @line over - cmove> r ;
|
||||
forth definitions
|
||||
only forth definitions
|
||||
|
||||
@ -140,21 +140,39 @@ ORDER ( -- ) Print the vocabulary search order
|
||||
SEALED ( -- ) Alter the last vocabulary defined so it doesn't chain
|
||||
</pre>
|
||||
|
||||
<h5>Block Editor</h5>
|
||||
<h5>Blocks</h5>
|
||||
<pre>
|
||||
USE ( "name" -- ) Use "name" as the blockfile, e.g. USE /spiffs/foo
|
||||
OPEN-BLOCKS ( a n -- ) Open a file as the block file
|
||||
LOAD ( n -- ) Evaluate a block
|
||||
THRU ( a b -- ) Load blocks a thru b
|
||||
LIST ( n -- ) List a block
|
||||
L ( -- ) List the current block
|
||||
BLOCK ( n -- a ) Get a 1024 byte block
|
||||
BUFFER ( n -- a ) Get a 1024 byte block without regard to old contents
|
||||
UPDATE ( -- ) Mark the last block modified
|
||||
FLUSH ( -- ) Save and empty all buffers
|
||||
EMPTY-BUFFERS ( -- ) Empty all buffers
|
||||
SAVE-BUFFERS ( -- ) Save all buffers
|
||||
SCR ( -- a ) Pointer to last listed block
|
||||
</pre>
|
||||
|
||||
<h5>Block Editor</h5>
|
||||
These words are available inside the <code>EDITOR</code> vocabulary.
|
||||
<pre>
|
||||
WIPE ( -- ) Blank out the current block
|
||||
L ( -- ) List the current block
|
||||
D ( n -- ) Delete a line in the current block
|
||||
E ( n -- ) Clear a line in the current block
|
||||
R ( n "text" -- ) Replace a line in the current block
|
||||
A ( n "text" -- ) Add (insert) a line in the current block
|
||||
P ( -- ) Move to the previous block
|
||||
N ( -- ) Move to the next block
|
||||
</pre>
|
||||
|
||||
<h5>Utilities</h5>
|
||||
<pre>
|
||||
SEE ( "name" -- ) Attempt to decompile a word
|
||||
VARIABLE ECHO -- Determines if commands are echoed
|
||||
ECHO ( -- a ) -- Address of flag that determines if commands are echoed
|
||||
</pre>
|
||||
|
||||
<h3>ESP32 Arduino</h3>
|
||||
|
||||
Reference in New Issue
Block a user