fuel.help: change find-word to use words-named.

It still returns the "first" word found (which might be dubious), but
now it supports qualified search like "math:+" find-word.
factor-shell
John Benediktsson 2018-02-05 15:40:46 -08:00
parent 8667655b3d
commit 849b6d76f4
1 changed files with 7 additions and 6 deletions

View File

@ -1,10 +1,11 @@
! Copyright (C) 2009 Jose Antonio Ortega Ruiz. ! Copyright (C) 2009 Jose Antonio Ortega Ruiz.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs combinators combinators.short-circuit USING: accessors arrays assocs combinators
fry help help.crossref help.markup help.markup.private help.topics combinators.short-circuit help help.crossref help.markup
help.vocabs io io.streams.string kernel make namespaces parser help.markup.private help.topics help.vocabs io io.streams.string
prettyprint see sequences splitting summary vocabs vocabs.hierarchy kernel make namespaces parser prettyprint see sequences
vocabs.metadata vocabs.parser words ; splitting summary vocabs vocabs.hierarchy vocabs.metadata
vocabs.parser words ;
IN: fuel.help IN: fuel.help
SYMBOLS: $doc-path $next-link $prev-link $fuel-nav-crumbs ; SYMBOLS: $doc-path $next-link $prev-link $fuel-nav-crumbs ;
@ -35,7 +36,7 @@ SYMBOLS: $doc-path $next-link $prev-link $fuel-nav-crumbs ;
<PRIVATE <PRIVATE
: find-word ( name -- word/f ) : find-word ( name -- word/f )
{ [ search ] [ '[ name>> _ = ] all-words swap find nip ] } 1|| ; { [ search ] [ words-named ?first ] } 1|| ;
: definition-str ( word -- str ) : definition-str ( word -- str )
[ see ] with-string-writer ; inline [ see ] with-string-writer ; inline