From 909353c3d982b1649511b0ce883070ea19233727 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Sat, 5 Feb 2022 21:05:39 -0800 Subject: [PATCH] More verbose see. --- ueforth/common/core.h | 1 + ueforth/common/utils.fs | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ueforth/common/core.h b/ueforth/common/core.h index 361dff9..ba704dd 100644 --- a/ueforth/common/core.h +++ b/ueforth/common/core.h @@ -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"); diff --git a/ueforth/common/utils.fs b/ueforth/common/utils.fs index c61ef44..720b202 100644 --- a/ueforth/common/utils.fs +++ b/ueforth/common/utils.fs @@ -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 )