More verbose see.

This commit is contained in:
Brad Nelson
2022-02-05 21:05:39 -08:00
parent 8ed00fda7d
commit 909353c3d9
2 changed files with 9 additions and 3 deletions

View File

@ -233,6 +233,7 @@ static void forth_init(int argc, char *argv[], void *heap,
for (int i = 0; i < VOCABULARY_DEPTH; ++i) { *g_sys.heap++ = 0; }
forth_run(0);
g_sys.latestxt = 0; // So ; doesn't get wrong size.
g_sys.DOLIT_XT = FIND("DOLIT");
g_sys.DOFLIT_XT = FIND("DOFLIT");
g_sys.DOEXIT_XT = FIND("EXIT");

View File

@ -55,9 +55,14 @@ internals definitions
: see-loop dup >body swap >params 1- cells over +
begin 2dup < while swap see-one swap repeat 2drop ;
: see-xt ( xt -- )
dup @ ['] see-loop @ <>
if ." Unsupported word type: " see. cr exit then
['] : see. dup see. space see-loop ['] ; see. cr ;
dup @ ['] see-loop @ = if
['] : see. dup see. space see-loop ['] ; see. cr exit
then
dup @ ['] input-buffer @ = if ." CREATE/VARIABLE: " see. cr exit then
dup @ ['] SMUDGE @ = if ." DOES>/CONSTANT: " see. cr exit then
dup >params 0= if ." Built-in: " see. cr exit then
." Unsupported: " see. cr ;
: nonvoc? ( xt -- f )
dup 0= if exit then dup >name nip swap >flags NONAMED and or ;
: see-vocabulary ( voc )