USING: io io.streams.string io.streams.duplex listener
tools.test parser math namespaces continuations vocabs kernel
-compiler.units eval vocabs.parser ;
+compiler.units eval vocabs.parser words definitions ;
IN: listener.tests
SYNTAX: hello "Hi" print ;
drop
] unit-test
] 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
"vocabs.refresh"
"vocabs.hierarchy"
"words"
- "scratchpad"
} interactive-vocabs set-global
-: only-use-vocabs ( vocabs -- )
- clear-manifest
+: use-loaded-vocabs ( vocabs -- )
[ lookup-vocab ] filter
[
lookup-vocab
: with-interactive-vocabs ( quot -- )
[
"scratchpad" set-current-vocab
- interactive-vocabs get only-use-vocabs
+ interactive-vocabs get use-loaded-vocabs
call
] with-manifest ; inline
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 ;
<PRIVATE