From 46da224f8be7aaabed77d8d43186796a721afaa1 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 13 Mar 2009 23:12:56 -0500 Subject: [PATCH] Update regexp and tools.deploy docs --- .../combinators/combinators-docs.factor | 18 +++- basis/regexp/regexp-docs.factor | 85 +++++++++++++++---- basis/tools/deploy/deploy-docs.factor | 38 ++++++--- 3 files changed, 113 insertions(+), 28 deletions(-) diff --git a/basis/regexp/combinators/combinators-docs.factor b/basis/regexp/combinators/combinators-docs.factor index 7cb214f42b..a49b16b585 100644 --- a/basis/regexp/combinators/combinators-docs.factor +++ b/basis/regexp/combinators/combinators-docs.factor @@ -5,16 +5,32 @@ IN: regexp.combinators ABOUT: "regexp.combinators" +ARTICLE: "regexp.combinators.intro" "Regular expression combinator rationale" +"Regular expression combinators are useful when part of the regular expression contains user input. For example, given a sequence of strings on the stack, a regular expression which matches any one of them can be constructed:" +{ $code + "[ ] map " +} +"Without combinators, a naive approach would look as follows:" +{ $code + "\"|\" join " +} +"However, this code is incorrect, because one of the strings in the sequence might contain characters which have special meaning inside a regular expression. Combinators avoid this problem by building a regular expression syntax tree directly, without any parsing." ; + ARTICLE: "regexp.combinators" "Regular expression combinators" -"The " { $vocab-link "regexp.combinators" } " vocabulary defines combinators which can be used to build up regular expressions to match strings. This is in addition to the traditional syntax defined in the " { $vocab-link "regexp" } " vocabulary." +"The " { $vocab-link "regexp.combinators" } " vocabulary defines combinators which can be used to build up regular expressions to match strings. This complements the traditional syntax defined in the " { $vocab-link "regexp" } " vocabulary." +{ $subsection "regexp.combinators.intro" } +"Basic combinators:" { $subsection } { $subsection } +"Higher-order combinators for building new regular expressions from existing ones:" { $subsection } { $subsection } { $subsection } { $subsection } { $subsection } +"Derived combinators implemented in terms of the above:" { $subsection } +"Setting options:" { $subsection