Determine restart vocab thru obj>> instead of error string
parent
86a6b75160
commit
af7ecb16cf
|
@ -2,8 +2,8 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
|
||||||
USING: accessors assocs compiler.units continuations fuel.eval fuel.help
|
USING: accessors assocs compiler.units continuations fuel.eval fuel.help
|
||||||
fuel.remote fuel.xref help.topics io.pathnames kernel math namespaces parser
|
fuel.remote fuel.xref help.topics io.pathnames kernel namespaces parser
|
||||||
sequences tools.scaffold vocabs.loader ;
|
sequences tools.scaffold vocabs.loader words ;
|
||||||
|
|
||||||
IN: fuel
|
IN: fuel
|
||||||
|
|
||||||
|
@ -33,10 +33,8 @@ SYMBOL: :uses-suggestions
|
||||||
: is-use-restart ( restart -- ? )
|
: is-use-restart ( restart -- ? )
|
||||||
name>> [ "Use the " head? ] [ " vocabulary" tail? ] bi and ;
|
name>> [ "Use the " head? ] [ " vocabulary" tail? ] bi and ;
|
||||||
|
|
||||||
: get-restart-vocab ( restart -- vocab )
|
: get-restart-vocab ( restart -- vocab/f )
|
||||||
[ "Use the " length ] dip
|
obj>> dup word? [ vocabulary>> ] [ drop f ] if ;
|
||||||
name>> [ length " vocabulary" length - ] keep
|
|
||||||
subseq ;
|
|
||||||
|
|
||||||
: is-suggested-restart ( restart -- ? )
|
: is-suggested-restart ( restart -- ? )
|
||||||
dup is-use-restart [
|
dup is-use-restart [
|
||||||
|
@ -56,9 +54,9 @@ SYMBOL: :uses-suggestions
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: fuel-use-suggested-vocabs ( ... suggestions quot: ( ... -- ... ) -- ... )
|
: fuel-use-suggested-vocabs ( suggestions quot ... suggestions quot: ( ... -- ... ) -- ... )
|
||||||
[ :uses-suggestions set ] dip
|
[ :uses-suggestions set ] dip
|
||||||
[ try-suggested-restarts rethrow ] recover ;
|
[ try-suggested-restarts rethrow ] recover ; inline
|
||||||
|
|
||||||
: fuel-run-file ( path -- )
|
: fuel-run-file ( path -- )
|
||||||
[ fuel-set-use-hook run-file ] curry with-scope ; inline
|
[ fuel-set-use-hook run-file ] curry with-scope ; inline
|
||||||
|
|
Loading…
Reference in New Issue