]> gitweb.factorcode.org Git - factor.git/commitdiff
locals.parser: docs for with-lambda-scope and some random doc additions 1369/head
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 22 Jun 2015 08:59:00 +0000 (10:59 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Mon, 22 Jun 2015 09:15:48 +0000 (11:15 +0200)
basis/locals/parser/parser-docs.factor [new file with mode: 0644]
core/parser/parser-docs.factor
core/vocabs/loader/loader-docs.factor
core/vocabs/parser/parser-docs.factor

diff --git a/basis/locals/parser/parser-docs.factor b/basis/locals/parser/parser-docs.factor
new file mode 100644 (file)
index 0000000..ccd413b
--- /dev/null
@@ -0,0 +1,27 @@
+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"
index a4820f53cd91d95693fc27910c227c861dde3645..1fed04bd7aabdf93cb3d611e15a6f32dad8df606 100644 (file)
@@ -150,8 +150,8 @@ HELP: no-word
 
 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
index e4be81052fdb4b675380f2097734003e2c9f9fe5..520ee419455e5a6c31cfe31b3fc6dcb5de4fb982 100755 (executable)
@@ -92,7 +92,7 @@ HELP: find-vocab-root
 { $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." } ;
 
@@ -124,7 +124,7 @@ HELP: run
 
 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" } } }
index 95e1c81095d974bafd29fed4acd4d2364fef2980..9e58c0f89d188e7ae80309f1b61112f84f2994ae 100644 (file)
@@ -1,4 +1,5 @@
-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"
@@ -99,6 +100,16 @@ HELP: <manifest>
 { $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." }