From 7e1b29e440e40d074d810ca1898cf1e2d3f0c7be Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 26 Sep 2005 02:20:29 +0000 Subject: [PATCH] some fixes --- library/tools/debugger.factor | 4 ++-- library/tools/describe.factor | 21 +++++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/library/tools/debugger.factor b/library/tools/debugger.factor index 7adf8b100b..f585188213 100644 --- a/library/tools/debugger.factor +++ b/library/tools/debugger.factor @@ -100,8 +100,8 @@ M: string error. ( error -- ) print ; M: object error. ( error -- ) . ; -: :s ( -- ) "error-datastack" stack. ; -: :r ( -- ) "error-callstack" stack. ; +: :s ( -- ) "error-datastack" get stack. ; +: :r ( -- ) "error-callstack" get stack. ; : :get ( var -- value ) "error-namestack" get (get) ; diff --git a/library/tools/describe.factor b/library/tools/describe.factor index 4a0c6df1d1..89ef101ddc 100644 --- a/library/tools/describe.factor +++ b/library/tools/describe.factor @@ -39,15 +39,28 @@ DEFER: describe : word. ( word -- ) dup word-name swap dup [ see ] curry write-outliner ; -: vocab. ( vocab -- ) - f over [ words [ word. ] each ] curry write-outliner ; +: word-outline ( words quot -- ) + swap [ + [ word-name ] keep rot dupd curry write-outliner + ] each-with ; -: browser ( -- ) +: words. ( vocab -- ) + words [ see ] word-outline ; + +: vocabs. ( -- ) #! Outlining word browser. - vocabs [ vocab. ] each ; + vocabs [ f over [ words. ] curry write-outliner ] each ; : stack. ( seq -- seq ) reverse-slice >array describe ; +: usage. ( word -- ) + #! Outlining usages browser. + usage [ usage. ] word-outline ; + +: uses. ( word -- ) + #! Outlining call hierarchy browser. + uses [ uses. ] word-outline ; + : .s datastack stack. ; : .r callstack stack. ;