diff --git a/extra/tools/annotations/annotations.factor b/extra/tools/annotations/annotations.factor index d24d60cef6..e97f292416 100644 --- a/extra/tools/annotations/annotations.factor +++ b/extra/tools/annotations/annotations.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2007 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: kernel words parser io inspector quotations sequences -prettyprint continuations ; +prettyprint continuations effects ; IN: tools.annotations : annotate ( word quot -- ) @@ -9,17 +9,29 @@ IN: tools.annotations swap define-compound do-parse-hook ; inline -: entering ( str -- ) "! Entering: " write print .s flush ; +: entering ( str -- ) + "/-- Entering: " write dup . + stack-effect [ + >r datastack r> effect-in length tail* stack. + ] [ + .s + ] if* "\\--" print flush ; -: leaving ( str -- ) "! Leaving: " write print .s flush ; +: leaving ( str -- ) + "/-- Leaving: " write dup . + stack-effect [ + >r datastack r> effect-out length tail* stack. + ] [ + .s + ] if* "\\--" print flush ; -: (watch) ( str def -- def ) +: (watch) ( word def -- def ) over [ entering ] curry rot [ leaving ] curry swapd 3append ; : watch ( word -- ) - dup word-name swap [ (watch) ] annotate ; + dup [ (watch) ] annotate ; : breakpoint ( word -- ) [ \ break add* ] annotate ;