--- /dev/null
+USING: help.markup help.syntax locals locals.types quotations strings
+vocabs.parser ;
+IN: locals.parser
+
+HELP: in-lambda?
+{ $var-description { $link t } " if we're currently parsing a lambda with lexical variables." } ;
+
+HELP: parse-def
+{ $values
+ { "name/paren" string }
+ { "def" "a " { $link def } " or a " { $link multi-def } }
+}
+{ $description "Parses the lexical variable bindings following a " { $link \ :> } " token." } ;
+
+HELP: with-lambda-scope
+{ $values { "assoc" "local variables" } { "reader-quot" quotation } }
+{ $description "Runs the quotation in a lambda scope. That means changes the qutoation does to the " { $link manifest } " will not escape after the qutoation ends." } ;
+
+ARTICLE: "locals.parser" "Utility words used by locals parsing words"
+"Words for parsing local words."
+$nl
+"Words for parsing variable assignments:"
+{ $subsections parse-def parse-multi-def parse-single-def }
+"Parsers for word and method definitions:"
+{ $subsections (::) (M::) } ;
+
+ABOUT: "locals.parser"
HELP: parse-word
{ $values { "string" string } { "word" word } }
-{ $description "If " { $snippet "string" } " is a valid number literal, it is converted to a number, otherwise the current vocabulary search path is searched for a word named by the string." }
-{ $errors "Throws an error if the token does not name a word, and does not parse as a number." }
+{ $description "The current vocabulary search path is searched for all words named by the " { $snippet "string" } ". If no words matches, an error is thrown, if one word matches, and it is already loaded, that word is returned. Otherwise throws a restartable error to let the user choose which word to use." }
+{ $errors "Throws a " { $link no-word-error } " if the string doesn't name a word." }
{ $notes "This word is used to implement " { $link scan-word } "." } ;
HELP: parse-datum
{ $description "Searches for a vocabulary in the vocabulary roots." } ;
HELP: no-vocab
-{ $values { "name" "a vocabulary name" } }
+{ $values { "name" "a vocabulary name" } }
{ $description "Throws a " { $link no-vocab } "." }
{ $error-description "Thrown when a " { $link POSTPONE: USE: } " or " { $link POSTPONE: USING: } " form refers to a non-existent vocabulary." } ;
HELP: vocab-source-path
{ $values { "vocab" "a vocabulary specifier" } { "path/f" { $maybe "a pathname string" } } }
-{ $description "Outputs a pathname where source code for " { $snippet "vocab" } " might be found. Outputs " { $link f } " if the vocabulary does not have a directory on disk." } ;
+{ $description "Outputs a pathname where source code for " { $snippet "vocab" } " might be found. Outputs " { $link f } " if the vocabulary does not have a known directory on disk." } ;
HELP: vocab-docs-path
{ $values { "vocab" "a vocabulary specifier" } { "path/f" { $maybe "a pathname string" } } }
-USING: help.markup help.syntax parser strings words assocs vocabs ;
+USING: assocs continuations help.markup help.syntax parser sequences strings
+words vocabs ;
IN: vocabs.parser
ARTICLE: "word-search-errors" "Word lookup errors"
{ $values { "manifest" manifest } }
{ $description "Creates a new manifest." } ;
+HELP: <no-word-error>
+{ $values
+ { "name" "name of the missing words" }
+ { "possibilities" sequence }
+ { "error" error }
+ { "restarts" sequence }
+}
+{ $description "Creates a no word error." } ;
+
+
HELP: set-current-vocab
{ $values { "name" string } }
{ $description "Sets the current vocabulary where new words will be defined, creating the vocabulary first if it does not exist." }