From 3f818637cd49f59a453aecf13fd0748f307830fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Sat, 24 Jun 2017 00:14:52 +0200 Subject: [PATCH] tools.trace: we can surely hardcode the excluded vocab list --- basis/tools/trace/trace-tests.factor | 16 +++++++++----- basis/tools/trace/trace.factor | 31 ++++++---------------------- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/basis/tools/trace/trace-tests.factor b/basis/tools/trace/trace-tests.factor index 335f37331a..b221e9fc3b 100644 --- a/basis/tools/trace/trace-tests.factor +++ b/basis/tools/trace/trace-tests.factor @@ -1,6 +1,6 @@ IN: tools.trace.tests -USING: tools.trace tools.test tools.continuations kernel math combinators -sequences ; +USING: combinators kernel math sequences tools.continuations +tools.test tools.trace tools.trace.private ; { { 3 2 1 } } [ { 1 2 3 } [ reverse ] trace ] unit-test @@ -22,9 +22,15 @@ M: method-breakpoint-tuple method-breakpoint-test break drop 1 2 + ; { 6 } [ [ case-breakpoint-test ] trace ] unit-test -: call(-breakpoint-test ( -- x ) +: call-op-para-breakpoint-test ( -- x ) [ break 1 ] call( -- x ) 2 + ; -\ call(-breakpoint-test don't-step-into +\ call-op-para-breakpoint-test don't-step-into -{ 3 } [ [ call(-breakpoint-test ] trace ] unit-test +{ 3 } [ [ call-op-para-breakpoint-test ] trace ] unit-test + +{ f t t } [ + \ + into? + \ dip into? + \ sq into? +] unit-test diff --git a/basis/tools/trace/trace.factor b/basis/tools/trace/trace.factor index 21107fa042..57f2adb4b4 100644 --- a/basis/tools/trace/trace.factor +++ b/basis/tools/trace/trace.factor @@ -1,17 +1,11 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: concurrency.promises models tools.continuations kernel -sequences concurrency.messaging locals continuations threads -namespaces namespaces.private make assocs accessors io strings -prettyprint math math.parser words effects summary io.styles classes -generic.math combinators.short-circuit kernel.private quotations ; +USING: accessors classes combinators.short-circuit effects +generic.math io io.styles kernel kernel.private make math.parser +namespaces prettyprint quotations sequences strings summary +tools.continuations words ; IN: tools.trace -SYMBOL: exclude-vocabs -SYMBOL: include-vocabs - -exclude-vocabs { "math" "accessors" } swap set-global - > include? ] - [ vocabulary>> exclude? not ] - } 1&& - ] - } 1|| + [ inline? ] + [ vocabulary>> { "math" "accessors" } member? not ] bi or ] } 1&& ;