Set up listener's manifest so that words defined in "scratchpad" take precedence over other vocabularies and do not raise a restart. This matches the behavior of IN: and USE: in files, where the IN: takes precedence. Also remove unused clear-manifest word. Fixes #407
parent
b994848d5f
commit
d1b6106011
|
@ -1,6 +1,6 @@
|
||||||
USING: io io.streams.string io.streams.duplex listener
|
USING: io io.streams.string io.streams.duplex listener
|
||||||
tools.test parser math namespaces continuations vocabs kernel
|
tools.test parser math namespaces continuations vocabs kernel
|
||||||
compiler.units eval vocabs.parser ;
|
compiler.units eval vocabs.parser words definitions ;
|
||||||
IN: listener.tests
|
IN: listener.tests
|
||||||
|
|
||||||
SYNTAX: hello "Hi" print ;
|
SYNTAX: hello "Hi" print ;
|
||||||
|
@ -52,3 +52,16 @@ SYNTAX: hello "Hi" print ;
|
||||||
drop
|
drop
|
||||||
] unit-test
|
] unit-test
|
||||||
] with-file-vocabs
|
] with-file-vocabs
|
||||||
|
|
||||||
|
[ "call" "scratchpad" create drop ] with-compilation-unit
|
||||||
|
|
||||||
|
[
|
||||||
|
[ t ]
|
||||||
|
[
|
||||||
|
"call" "scratchpad" lookup-word
|
||||||
|
[ "call" search ] with-interactive-vocabs
|
||||||
|
eq?
|
||||||
|
] unit-test
|
||||||
|
] with-file-vocabs
|
||||||
|
|
||||||
|
[ "call" "scratchpad" lookup-word forget ] with-compilation-unit
|
||||||
|
|
|
@ -185,11 +185,9 @@ SYMBOL: interactive-vocabs
|
||||||
"vocabs.refresh"
|
"vocabs.refresh"
|
||||||
"vocabs.hierarchy"
|
"vocabs.hierarchy"
|
||||||
"words"
|
"words"
|
||||||
"scratchpad"
|
|
||||||
} interactive-vocabs set-global
|
} interactive-vocabs set-global
|
||||||
|
|
||||||
: only-use-vocabs ( vocabs -- )
|
: use-loaded-vocabs ( vocabs -- )
|
||||||
clear-manifest
|
|
||||||
[ lookup-vocab ] filter
|
[ lookup-vocab ] filter
|
||||||
[
|
[
|
||||||
lookup-vocab
|
lookup-vocab
|
||||||
|
@ -201,7 +199,7 @@ SYMBOL: interactive-vocabs
|
||||||
: with-interactive-vocabs ( quot -- )
|
: with-interactive-vocabs ( quot -- )
|
||||||
[
|
[
|
||||||
"scratchpad" set-current-vocab
|
"scratchpad" set-current-vocab
|
||||||
interactive-vocabs get only-use-vocabs
|
interactive-vocabs get use-loaded-vocabs
|
||||||
call
|
call
|
||||||
] with-manifest ; inline
|
] with-manifest ; inline
|
||||||
|
|
||||||
|
|
|
@ -49,13 +49,6 @@ M: extra-words equal?
|
||||||
|
|
||||||
C: <extra-words> extra-words
|
C: <extra-words> extra-words
|
||||||
|
|
||||||
: clear-manifest ( -- )
|
|
||||||
manifest get
|
|
||||||
[ search-vocab-names>> clear-assoc ]
|
|
||||||
[ search-vocabs>> delete-all ]
|
|
||||||
[ qualified-vocabs>> delete-all ]
|
|
||||||
tri ;
|
|
||||||
|
|
||||||
ERROR: no-word-in-vocab word vocab ;
|
ERROR: no-word-in-vocab word vocab ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
Loading…
Reference in New Issue