locals.parser: docs for with-lambda-scope and some random doc additions

db4
Björn Lindqvist 2015-06-22 10:59:00 +02:00
parent 976961bfbd
commit d32b9f9c90
4 changed files with 43 additions and 5 deletions

View File

@ -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"

View 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

View File

@ -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" } } }

View 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." }