]> gitweb.factorcode.org Git - factor.git/blobdiff - core/parser/parser-docs.factor
Merge qualified, alias, symbols, constants into core
[factor.git] / core / parser / parser-docs.factor
index 92e5922802bbab824b4691a228d27f1792282303..625c1e9c4318e7ccd7c6fbc5de779ffe64523198 100644 (file)
@@ -1,78 +1,10 @@
 USING: help.markup help.syntax kernel sequences words
 math strings vectors quotations generic effects classes
 vocabs.loader definitions io vocabs source-files
-quotations namespaces compiler.units assocs lexer ;
+quotations namespaces compiler.units assocs lexer
+words.symbol words.alias words.constant vocabs.parser ;
 IN: parser
 
-ARTICLE: "vocabulary-search-shadow" "Shadowing word names"
-"If adding a vocabulary to the search path results in a word in another vocabulary becoming inaccessible due to the new vocabulary defining a word with the same name, we say that the old word has been " { $emphasis "shadowed" } "."
-$nl
-"Here is an example where shadowing occurs:"
-{ $code
-    "IN: foe"
-    "USING: sequences io ;"
-    ""
-    ": append"
-    "    \"foe::append calls sequences:append\" print  append ;"
-    ""
-    "IN: fee"
-    ""
-    ": append"
-    "    \"fee::append calls fee:append\" print  append ;"
-    ""
-    "IN: fox"
-    "USE: foe"
-    ""
-    ": append"
-    "    \"fox::append calls foe:append\" print  append ;"
-    ""
-    "\"1234\" \"5678\" append print"
-    ""
-    "USE: fox"
-    "\"1234\" \"5678\" append print"
-}
-"When placed in a source file and run, the above code produces the following output:"
-{ $code
-    "foe:append calls sequences:append"
-    "12345678"
-    "fee:append calls foe:append"
-    "foe:append calls sequences:append"
-    "12345678"
-}
-"The " { $vocab-link "qualified" } " vocabulary contains some tools for helping with shadowing." ;
-
-ARTICLE: "vocabulary-search-errors"  "Word lookup errors"
-"If the parser cannot not find a word in the current vocabulary search path, it attempts to look for the word in all loaded vocabularies."
-$nl
-"If " { $link auto-use? } " mode is off, a restartable error is thrown with a restart for each vocabulary in question, together with a restart which defers the word in the current vocabulary, as if " { $link POSTPONE: DEFER: } " was used."
-$nl
-"If " { $link auto-use? } " mode is on and only one vocabulary has a word with this name, the vocabulary is added to the search path and parsing continues."
-$nl
-"If any restarts were invoked, or if " { $link auto-use? } " is on, the parser will print the correct " { $link POSTPONE: USING: } " after parsing completes. This form can be copy and pasted back into the source file."
-{ $subsection auto-use? } ;
-
-ARTICLE: "vocabulary-search" "Vocabulary search path"
-"When the parser reads a token, it attempts to look up a word named by that token. The lookup is performed by searching each vocabulary in the search path, in order."
-$nl
-"For a source file the vocabulary search path starts off with one vocabulary:"
-{ $code "syntax" }
-"The " { $vocab-link "syntax" } " vocabulary consists of a set of parsing words for reading Factor data and defining new words."
-$nl
-"In the listener, the " { $vocab-link "scratchpad" } " is the default vocabulary for new word definitions. However, when loading source files, there is no default vocabulary. Defining words before declaring a vocabulary with " { $link POSTPONE: IN: } " results in an error."
-$nl
-"At the interactive listener, the default search path contains many more vocabularies. Details on the default search path and parser invocation are found in " { $link "parser" } "."
-$nl
-"Three parsing words deal with the vocabulary search path:"
-{ $subsection POSTPONE: USE: }
-{ $subsection POSTPONE: USING: }
-{ $subsection POSTPONE: IN: }
-"Private words can be defined; note that this is just a convention and they can be called from other vocabularies anyway:"
-{ $subsection POSTPONE: <PRIVATE }
-{ $subsection POSTPONE: PRIVATE> }
-{ $subsection "vocabulary-search-errors" }
-{ $subsection "vocabulary-search-shadow" }
-{ $see-also "words" "qualified" } ;
-
 ARTICLE: "reading-ahead" "Reading ahead"
 "Parsing words can consume input:"
 { $subsection scan }