tools.crossref: change crossref to store uses in hash-set.

Previously it would use a hashtable where the key and value
were both the same.
locals-and-roots
John Benediktsson 2016-03-20 20:20:34 -07:00
parent 1031a02d15
commit 12628c5a95
2 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,7 @@
! Copyright (C) 2005, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs combinators.smart compiler.units
generic generic.single graphs hash-sets.identity hashtables help
generic generic.single hash-sets.identity hashtables help
help.crossref help.markup help.topics init io io.pathnames
io.styles kernel namespaces quotations see sequences sets
sorting source-files threads vocabs words ;
@ -57,7 +57,7 @@ M: pathname uses string>> path>source-file top-level-form>> [ uses ] [ { } ] if*
M: object uses drop f ;
: crossref-def ( defspec -- )
dup uses crossref get-global add-vertex ;
dup uses [ crossref get-global adjoin-at ] with each ;
: defs-to-crossref ( -- seq )
[
@ -91,7 +91,7 @@ M: predicate-engine-word irrelevant? drop t ;
PRIVATE>
: usage ( defspec -- seq ) get-crossref at keys ;
: usage ( defspec -- seq ) get-crossref at members ;
GENERIC: smart-usage ( defspec -- seq )
@ -139,7 +139,8 @@ M: f smart-usage drop \ f smart-usage ;
SINGLETON: invalidate-crossref
M: invalidate-crossref definitions-changed 2drop crossref global delete-at ;
M: invalidate-crossref definitions-changed
2drop crossref global delete-at ;
[ invalidate-crossref add-definition-observer ] "tools.crossref" add-startup-hook

View File

@ -64,7 +64,7 @@ SINGLETON: deprecation-observer
: initialize-deprecation-notes ( -- )
[
get-crossref [ drop deprecated? ] assoc-filter
values [ keys [ check-deprecations ] each ] each
values [ members [ check-deprecations ] each ] each
] with-null-writer ;
M: deprecation-observer definitions-changed