Fix loader regression
parent
ce2780ad54
commit
3664f7af1b
|
@ -1,7 +1,7 @@
|
|||
USING: arrays math parser tools.test kernel generic words
|
||||
io.streams.string namespaces classes effects source-files
|
||||
assocs sequences strings io.files definitions continuations
|
||||
sorting tuples compiler.units debugger vocabs.loader ;
|
||||
sorting tuples compiler.units debugger vocabs vocabs.loader ;
|
||||
IN: parser.tests
|
||||
|
||||
[
|
||||
|
@ -461,3 +461,11 @@ must-fail-with
|
|||
] times
|
||||
|
||||
[ ] [ "parser" reload ] unit-test
|
||||
|
||||
[ ] [
|
||||
[ "this-better-not-exist" forget-vocab ] with-compilation-unit
|
||||
] unit-test
|
||||
|
||||
[
|
||||
"USE: this-better-not-exist" eval
|
||||
] must-fail
|
||||
|
|
|
@ -113,7 +113,11 @@ M: string (load-vocab)
|
|||
rethrow
|
||||
] [
|
||||
drop
|
||||
[ (load-vocab) ] with-compiler-errors
|
||||
dup find-vocab-root [
|
||||
[ (load-vocab) ] with-compiler-errors
|
||||
] [
|
||||
dup vocab [ drop ] [ no-vocab ] if
|
||||
] if
|
||||
] if
|
||||
] with-compiler-errors
|
||||
] load-vocab-hook set-global
|
||||
|
|
|
@ -64,8 +64,7 @@ ERROR: no-vocab name ;
|
|||
SYMBOL: load-vocab-hook ! ( name -- )
|
||||
|
||||
: load-vocab ( name -- vocab )
|
||||
dup load-vocab-hook get call
|
||||
dup vocab [ ] [ vocab-name no-vocab ] ?if ;
|
||||
dup load-vocab-hook get call vocab ;
|
||||
|
||||
: vocabs ( -- seq )
|
||||
dictionary get keys natural-sort ;
|
||||
|
|
Loading…
Reference in New Issue