]> gitweb.factorcode.org Git - factor.git/commitdiff
Recent vocabs.parser change had a regression: vocabs with no roots (scratchpad) were...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 8 Jun 2009 02:59:13 +0000 (21:59 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 8 Jun 2009 02:59:13 +0000 (21:59 -0500)
basis/help/lint/lint.factor
basis/listener/listener-docs.factor
basis/listener/listener.factor
basis/prettyprint/prettyprint-tests.factor
core/parser/parser.factor
core/vocabs/parser/parser-docs.factor
core/vocabs/parser/parser.factor

index 08cf4b2cd4932bdf8235a904ca34bbac9dd65364..4ead01159ae67e5ea3794323f61516773d058a88 100755 (executable)
@@ -3,7 +3,7 @@
 USING: assocs continuations fry help help.lint.checks
 help.topics io kernel namespaces parser sequences
 source-files.errors vocabs.hierarchy vocabs words classes
-locals tools.errors ;
+locals tools.errors listener ;
 FROM: help.lint.checks => all-vocabs ;
 IN: help.lint
 
index 0f13b6dd8624064c264d500e0f8b2edd4df0e00d..7470ef9daaf388a7ba0044ba7984e5ab27dabe00 100644 (file)
@@ -13,6 +13,10 @@ ARTICLE: "listener-watch" "Watching variables in the listener"
 "Hiding all visible variables:"
 { $subsection hide-all-vars } ;
 
+HELP: only-use-vocabs
+{ $values { "vocabs" "a sequence of vocabulary specifiers" } }
+{ $description "Replaces the current manifest's vocabulary search path with the given set of vocabularies." } ;
+
 HELP: show-var
 { $values { "var" "a variable name" } }
 { $description "Adds a variable to the watch list; its value will be printed by the listener after every expression." } ;
index 4563f61ab79a146f08bf20a6d5a5dd6bcf0af38e..34d9eac121cb74d3458d816a3e85a4ca493c4359 100644 (file)
@@ -4,7 +4,7 @@ USING: arrays hashtables io kernel math math.parser memory
 namespaces parser lexer sequences strings io.styles
 vectors words generic system combinators continuations debugger
 definitions compiler.units accessors colors prettyprint fry
-sets vocabs.parser source-files.errors locals ;
+sets vocabs.parser source-files.errors locals vocabs vocabs.loader ;
 IN: listener
 
 GENERIC: stream-read-quot ( stream -- quot/f )
@@ -124,6 +124,78 @@ t error-summary? set-global
 
 PRIVATE>
 
+SYMBOL: interactive-vocabs
+
+{
+    "accessors"
+    "arrays"
+    "assocs"
+    "combinators"
+    "compiler"
+    "compiler.errors"
+    "compiler.units"
+    "continuations"
+    "debugger"
+    "definitions"
+    "editors"
+    "help"
+    "help.apropos"
+    "help.lint"
+    "help.vocabs"
+    "inspector"
+    "io"
+    "io.files"
+    "io.pathnames"
+    "kernel"
+    "listener"
+    "math"
+    "math.order"
+    "memory"
+    "namespaces"
+    "parser"
+    "prettyprint"
+    "see"
+    "sequences"
+    "slicing"
+    "sorting"
+    "stack-checker"
+    "strings"
+    "syntax"
+    "tools.annotations"
+    "tools.crossref"
+    "tools.disassembler"
+    "tools.errors"
+    "tools.memory"
+    "tools.profiler"
+    "tools.test"
+    "tools.threads"
+    "tools.time"
+    "vocabs"
+    "vocabs.loader"
+    "vocabs.refresh"
+    "vocabs.hierarchy"
+    "words"
+    "scratchpad"
+} interactive-vocabs set-global
+
+: only-use-vocabs ( vocabs -- )
+    clear-manifest
+    [ vocab ] filter
+    [
+        vocab
+        [ find-vocab-root not ]
+        [ source-loaded?>> +done+ eq? ] bi or
+    ] filter
+    [ use-vocab ] each ;
+
+: with-interactive-vocabs ( quot -- )
+    [
+        <manifest> manifest set
+        "scratchpad" set-current-vocab
+        interactive-vocabs get only-use-vocabs
+        call
+    ] with-scope ; inline
+
 : listener ( -- )
     [ [ { } (listener) ] with-interactive-vocabs ] with-return ;
 
index cd10278760c5b2e466adc7dc5b08c91515082359..a2696b12631e3fd478fa6a5c505fa3097eda38a7 100644 (file)
@@ -3,7 +3,8 @@ kernel math namespaces parser prettyprint prettyprint.config
 prettyprint.sections sequences tools.test vectors words
 effects splitting generic.standard prettyprint.private
 continuations generic compiler.units tools.continuations
-tools.continuations.private eval accessors make vocabs.parser see ;
+tools.continuations.private eval accessors make vocabs.parser see
+listener ;
 IN: prettyprint.tests
 
 [ "4" ] [ 4 unparse ] unit-test
index 8d52dcaa2cb50269031cf1ec3fbc4c85f7406f7e..94eb0a865cf563ef5a3092aa60bf3941d4e54922 100644 (file)
@@ -112,68 +112,6 @@ SYMBOL: bootstrap-syntax
         call
     ] with-scope ; inline
 
-SYMBOL: interactive-vocabs
-
-{
-    "accessors"
-    "arrays"
-    "assocs"
-    "combinators"
-    "compiler"
-    "compiler.errors"
-    "compiler.units"
-    "continuations"
-    "debugger"
-    "definitions"
-    "editors"
-    "help"
-    "help.apropos"
-    "help.lint"
-    "help.vocabs"
-    "inspector"
-    "io"
-    "io.files"
-    "io.pathnames"
-    "kernel"
-    "listener"
-    "math"
-    "math.order"
-    "memory"
-    "namespaces"
-    "parser"
-    "prettyprint"
-    "see"
-    "sequences"
-    "slicing"
-    "sorting"
-    "stack-checker"
-    "strings"
-    "syntax"
-    "tools.annotations"
-    "tools.crossref"
-    "tools.disassembler"
-    "tools.errors"
-    "tools.memory"
-    "tools.profiler"
-    "tools.test"
-    "tools.threads"
-    "tools.time"
-    "vocabs"
-    "vocabs.loader"
-    "vocabs.refresh"
-    "vocabs.hierarchy"
-    "words"
-    "scratchpad"
-} interactive-vocabs set-global
-
-: with-interactive-vocabs ( quot -- )
-    [
-        <manifest> manifest set
-        "scratchpad" set-current-vocab
-        interactive-vocabs get only-use-vocabs
-        call
-    ] with-scope ; inline
-
 SYMBOL: print-use-hook
 
 print-use-hook [ [ ] ] initialize
index e54993b6ebc0f628854fe2c1df868b03ac4d0b54..96619a7114e5d3a00e361e37c0fde772122b7337 100644 (file)
@@ -65,7 +65,6 @@ $nl
 "Words for working with the current manifest:"
 { $subsection use-vocab }
 { $subsection unuse-vocab }
-{ $subsection only-use-vocabs }
 { $subsection add-qualified }
 { $subsection add-words-from }
 { $subsection add-words-excluding }
@@ -117,10 +116,6 @@ HELP: unuse-vocab
 { $description "Removes a vocabulary from the current manifest." }
 { $notes "This word is used to implement " { $link POSTPONE: UNUSE: } "." } ;
 
-HELP: only-use-vocabs
-{ $values { "vocabs" "a sequence of vocabulary specifiers" } }
-{ $description "Replaces the current manifest's vocabulary search path with the given set of vocabularies." } ;
-
 HELP: add-qualified
 { $values { "vocab" "a vocabulary specifier" } { "prefix" string } }
 { $description "Adds the vocabulary's words, prefixed with the given string, to the current manifest." }
index 5f393ed65ded2bf4f95b11f0e226dc3750eabb78..0bfb607a52f67c33a95374405b96851684e35ac3 100644 (file)
@@ -52,8 +52,6 @@ M: extra-words equal?
 
 C: <extra-words> extra-words
 
-<PRIVATE
-
 : clear-manifest ( -- )
     manifest get
     [ search-vocab-names>> clear-assoc ]
@@ -61,6 +59,8 @@ C: <extra-words> extra-words
     [ qualified-vocabs>> delete-all ]
     tri ;
 
+<PRIVATE
+
 : (add-qualified) ( qualified -- )
     manifest get qualified-vocabs>> push ;
 
@@ -126,12 +126,6 @@ TUPLE: no-current-vocab ;
         2bi
     ] [ drop ] if ;
 
-: only-use-vocabs ( vocabs -- )
-    clear-manifest
-    [ vocab ] filter
-    [ vocab source-loaded?>> +done+ eq? ] filter
-    [ use-vocab ] each ;
-
 TUPLE: qualified vocab prefix words ;
 
 : <qualified> ( vocab prefix -- qualified )