diff --git a/core/classes/classes-tests.factor b/core/classes/classes-tests.factor index 35cbef42be..5addd273c8 100755 --- a/core/classes/classes-tests.factor +++ b/core/classes/classes-tests.factor @@ -2,7 +2,7 @@ USING: alien arrays definitions generic assocs hashtables io kernel math namespaces parser prettyprint sequences strings tools.test vectors words quotations classes io.streams.string classes.private classes.union classes.mixin classes.predicate -vectors definitions source-files ; +vectors definitions source-files compiler.units ; IN: temporary H{ } "s" set diff --git a/core/compiler/compiler-tests.factor b/core/compiler/compiler-tests.factor index 59e2aaace0..bd9b26ce6d 100644 --- a/core/compiler/compiler-tests.factor +++ b/core/compiler/compiler-tests.factor @@ -1,4 +1,5 @@ -USING: io.files tools.test sequences namespaces kernel ; +USING: io.files tools.test sequences namespaces kernel +compiler.units ; { "templates-early" diff --git a/core/compiler/test/optimizer.factor b/core/compiler/test/optimizer.factor index ba13dfe776..ecb5525fd0 100755 --- a/core/compiler/test/optimizer.factor +++ b/core/compiler/test/optimizer.factor @@ -47,7 +47,6 @@ IN: temporary sort-classes min-class ] unit-test -FORGET: xyz GENERIC: xyz ( obj -- obj ) M: array xyz xyz ; diff --git a/core/compiler/test/redefine.factor b/core/compiler/test/redefine.factor index f059f9ec81..ed7a0399fb 100755 --- a/core/compiler/test/redefine.factor +++ b/core/compiler/test/redefine.factor @@ -1,6 +1,6 @@ USING: compiler definitions generic assocs inference math namespaces parser tools.test words kernel sequences arrays io -effects tools.test.inference words.private ; +effects tools.test.inference compiler.units ; IN: temporary DEFER: x-1 @@ -173,3 +173,15 @@ DEFER: hints-test-2 [ ] [ "IN: temporary USE: math : hints-test-1 5 + ;" eval ] unit-test [ 10 ] [ hints-test-2 ] unit-test + +DEFER: inline-then-not-inline-test-2 + +[ ] [ "IN: temporary : inline-then-not-inline-test-1 1 2 3 ; inline" eval ] unit-test + +[ ] [ "IN: temporary : inline-then-not-inline-test-2 inline-then-not-inline-test-1 ;" eval ] unit-test + +[ 1 2 3 ] [ inline-then-not-inline-test-2 ] unit-test + +[ ] [ "IN: temporary : inline-then-not-inline-test-1 6 9 ;" eval ] unit-test + +[ 6 9 ] [ inline-then-not-inline-test-2 ] unit-test diff --git a/core/compiler/test/templates-early.factor b/core/compiler/test/templates-early.factor index 801d157ef7..795d331c00 100755 --- a/core/compiler/test/templates-early.factor +++ b/core/compiler/test/templates-early.factor @@ -2,7 +2,7 @@ IN: temporary USING: compiler generator generator.registers generator.registers.private tools.test namespaces sequences -words kernel math effects definitions ; +words kernel math effects definitions compiler.units ; : ( n -- vreg ) T{ int-regs } ; diff --git a/core/compiler/test/templates.factor b/core/compiler/test/templates.factor index 70120e6538..78f57efb43 100755 --- a/core/compiler/test/templates.factor +++ b/core/compiler/test/templates.factor @@ -2,7 +2,8 @@ USING: arrays compiler kernel kernel.private math hashtables.private math.private namespaces sequences sequences.private tools.test namespaces.private slots.private -combinators.private byte-arrays alien layouts words definitions ; +combinators.private byte-arrays alien layouts words definitions +compiler.units ; IN: temporary ! Oops! diff --git a/core/definitions/definitions-tests.factor b/core/definitions/definitions-tests.factor index 4f79cd3f54..13172c0ada 100755 --- a/core/definitions/definitions-tests.factor +++ b/core/definitions/definitions-tests.factor @@ -1,5 +1,6 @@ IN: temporary -USING: tools.test generic kernel definitions sequences ; +USING: tools.test generic kernel definitions sequences +compiler.units ; TUPLE: combination-1 ; diff --git a/core/generic/generic-tests.factor b/core/generic/generic-tests.factor index 5a16f40eb5..dc888ec30c 100755 --- a/core/generic/generic-tests.factor +++ b/core/generic/generic-tests.factor @@ -1,7 +1,8 @@ USING: alien arrays definitions generic generic.standard generic.math assocs hashtables io kernel math namespaces parser prettyprint sequences strings tools.test vectors words -quotations classes continuations layouts classes.union sorting ; +quotations classes continuations layouts classes.union sorting +compiler.units ; IN: temporary GENERIC: foobar ( x -- y ) diff --git a/core/inference/class/class-tests.factor b/core/inference/class/class-tests.factor index aa511b2bb6..63c117ba6b 100755 --- a/core/inference/class/class-tests.factor +++ b/core/inference/class/class-tests.factor @@ -3,7 +3,7 @@ USING: arrays math.private kernel math compiler inference inference.dataflow optimizer tools.test kernel.private generic sequences words inference.class quotations alien alien.c-types strings sbufs sequences.private -slots.private combinators definitions ; +slots.private combinators definitions compiler.units ; ! Make sure these compile even though this is invalid code [ ] [ [ 10 mod 3.0 /i ] dataflow optimize drop ] unit-test @@ -34,8 +34,6 @@ M: f detect-f ; [ ] [ [ fixnum< [ ] [ ] if ] dataflow optimize drop ] unit-test -FORGET: xyz - GENERIC: xyz ( n -- n ) M: integer xyz ; diff --git a/core/parser/parser-tests.factor b/core/parser/parser-tests.factor index 5591cff26a..8b308da57f 100755 --- a/core/parser/parser-tests.factor +++ b/core/parser/parser-tests.factor @@ -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 ; +sorting tuples compiler.units ; IN: temporary [ diff --git a/core/prettyprint/prettyprint-tests.factor b/core/prettyprint/prettyprint-tests.factor index bbb63db499..595dfa88da 100755 --- a/core/prettyprint/prettyprint-tests.factor +++ b/core/prettyprint/prettyprint-tests.factor @@ -2,7 +2,7 @@ USING: arrays definitions io.streams.string io.streams.duplex kernel math namespaces parser prettyprint prettyprint.config prettyprint.sections sequences tools.test vectors words effects splitting generic.standard prettyprint.private -continuations generic ; +continuations generic compiler.units ; IN: temporary [ "4" ] [ 4 unparse ] unit-test diff --git a/core/source-files/source-files-docs.factor b/core/source-files/source-files-docs.factor index 2d294779d6..36a7ae67bb 100755 --- a/core/source-files/source-files-docs.factor +++ b/core/source-files/source-files-docs.factor @@ -79,7 +79,8 @@ HELP: reset-checksums HELP: forget-source { $values { "path" "a pathname string" } } -{ $description "Forgets all information known about a source file." } ; +{ $description "Forgets all information known about a source file." } +{ $notes "This word must be called from inside " { $link with-compilation-unit } "." } ; HELP: record-definitions { $values { "file" source-file } } diff --git a/core/source-files/source-files.factor b/core/source-files/source-files.factor index 80538e2cf5..105353f23d 100755 --- a/core/source-files/source-files.factor +++ b/core/source-files/source-files.factor @@ -73,15 +73,14 @@ uses definitions ; M: pathname where pathname-string 1 2array ; -M: pathname forget* - pathname-string +: forget-source ( path -- ) dup source-file dup unxref-source source-file-definitions [ keys forget-all ] each source-files get delete-at ; -: forget-source ( path -- ) - [ forget ] with-compilation-unit ; +M: pathname forget* + pathname-string forget-source ; : rollback-source-file ( source-file -- ) dup source-file-definitions new-definitions get [ union ] 2map diff --git a/core/tuples/tuples-tests.factor b/core/tuples/tuples-tests.factor index 62bbc7ace5..edd2387645 100755 --- a/core/tuples/tuples-tests.factor +++ b/core/tuples/tuples-tests.factor @@ -2,7 +2,7 @@ USING: definitions generic kernel kernel.private math math.constants parser sequences tools.test words assocs namespaces quotations sequences.private classes continuations generic.standard effects tuples tuples.private arrays vectors -strings ; +strings compiler.units ; IN: temporary [ t ] [ \ tuple-class \ class class< ] unit-test diff --git a/core/vocabs/loader/loader-tests.factor b/core/vocabs/loader/loader-tests.factor index d0c8768c08..f38276d318 100755 --- a/core/vocabs/loader/loader-tests.factor +++ b/core/vocabs/loader/loader-tests.factor @@ -3,7 +3,7 @@ IN: temporary USING: vocabs.loader tools.test continuations vocabs math kernel arrays sequences namespaces io.streams.string parser source-files words assocs tuples definitions -debugger ; +debugger compiler.units ; ! This vocab should not exist, but just in case... [ ] [ @@ -50,9 +50,11 @@ IN: temporary 3array ] unit-test -"resource:core/vocabs/loader/test/a/a.factor" forget-source -[ "vocabs.loader.test.a" forget-vocab ] with-compilation-unit +[ + "resource:core/vocabs/loader/test/a/a.factor" forget-source + "vocabs.loader.test.a" forget-vocab +] with-compilation-unit 0 "count-me" set-global @@ -89,7 +91,10 @@ IN: temporary ] unit-test [ ] [ - "vocabs.loader.test.b" vocab-files [ forget-source ] each + [ + "vocabs.loader.test.b" vocab-files + [ forget-source ] each + ] with-compilation-unit ] unit-test [ "vocabs.loader.test.b" require ] unit-test-fails @@ -109,7 +114,10 @@ IN: temporary [ f ] [ "fred" "vocabs.loader.test.b" lookup undefined? ] unit-test [ ] [ - "vocabs.loader.test.b" vocab-files [ forget-source ] each + [ + "vocabs.loader.test.b" vocab-files + [ forget-source ] each + ] with-compilation-unit ] unit-test [ ] [ "vocabs.loader.test.b" refresh ] unit-test diff --git a/core/words/words-tests.factor b/core/words/words-tests.factor index 90108ef01a..a88892b5f4 100755 --- a/core/words/words-tests.factor +++ b/core/words/words-tests.factor @@ -1,6 +1,6 @@ USING: arrays generic assocs kernel math namespaces sequences tools.test words definitions parser quotations -vocabs continuations tuples ; +vocabs continuations tuples compiler.units ; IN: temporary [ 4 ] [ diff --git a/extra/help/crossref/crossref-tests.factor b/extra/help/crossref/crossref-tests.factor index 619c58b018..d3d21b8815 100755 --- a/extra/help/crossref/crossref-tests.factor +++ b/extra/help/crossref/crossref-tests.factor @@ -1,7 +1,7 @@ IN: temporary USING: help.crossref help.topics help.markup tools.test words definitions assocs sequences kernel namespaces parser arrays -io.streams.string continuations debugger ; +io.streams.string continuations debugger compiler.units ; [ ] [ "IN: temporary USING: help.syntax help.markup ; : foo ; HELP: foo \"foo is great\" ; ARTICLE: \"foo\" \"Foo\" { $subsection foo } ;" eval diff --git a/extra/tools/test/test.factor b/extra/tools/test/test.factor index 1cefce8721..87ab7abf71 100755 --- a/extra/tools/test/test.factor +++ b/extra/tools/test/test.factor @@ -1,9 +1,9 @@ -! Copyright (C) 2003, 2007 Slava Pestov. +! Copyright (C) 2003, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: namespaces arrays prettyprint sequences kernel vectors quotations words parser assocs combinators continuations debugger io io.files vocabs tools.time -vocabs.loader source-files ; +vocabs.loader source-files compiler.units ; IN: tools.test SYMBOL: failures @@ -35,14 +35,15 @@ TUPLE: expected-error ; [ t ] swap unit-test ; : run-test ( path -- failures ) - "temporary" forget-vocab + [ "temporary" forget-vocab ] with-compilation-unit [ V{ } clone [ failures [ [ run-file ] [ swap failure ] recover ] with-variable ] keep - ] keep forget-source ; + ] keep + [ forget-source ] with-compilation-unit ; : failure. ( triple -- ) dup second . diff --git a/extra/ui/traverse/traverse-tests.factor b/extra/ui/traverse/traverse-tests.factor index fd5bc6d8ec..37b3f25321 100755 --- a/extra/ui/traverse/traverse-tests.factor +++ b/extra/ui/traverse/traverse-tests.factor @@ -1,7 +1,7 @@ IN: temporary USING: ui.gadgets ui.gadgets.labels namespaces sequences kernel math arrays tools.test io ui.gadgets.panes ui.traverse -definitions ; +definitions compiler.units ; M: array gadget-children ;