Fix loader regression

Slava Pestov 2008-03-20 17:58:35 -05:00
parent ce2780ad54
commit 3664f7af1b
3 changed files with 15 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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 ;