]> gitweb.factorcode.org Git - factor.git/blob - basis/multiline/multiline-docs.factor
mason: update table style
[factor.git] / basis / multiline / multiline-docs.factor
1 USING: help.markup help.syntax strings ;
2 IN: multiline
3
4 HELP: STRING:
5 { $syntax "STRING: name\nfoo\n;" }
6 { $description "Forms a multiline string literal, or 'here document' stored in the word called name. A semicolon is used to signify the end, and that semicolon must be on a line by itself, not preceded or followed by any whitespace. The string will have newlines in between lines but not at the end, unless there is a blank line before the semicolon." } ;
7
8 HELP: /*
9 { $syntax "/* comment */" }
10 { $description "Provides C-like comments that can span multiple lines. One caveat is that " { $snippet "/*" } " and " { $snippet "*/" } " are still tokens and must not appear in the comment text itself. Another caveat is that, unlike in C, the whitespace space after the " { $snippet "/*" } " is mandatory." }
11 { $examples
12     { $example "USING: multiline ;"
13            "/* I think that I shall never see"
14            "   A poem lovely as a tree. */"
15            ""
16     }
17 } ;
18
19 HELP: parse-multiline-string
20 { $values { "end-text" "a string delineating the end" } { "str" "the parsed string" } }
21 { $description "Parses the input stream until the " { $snippet "end-text" } " is reached and returns the parsed text as a string." }
22 { $notes "Used to implement " { $link POSTPONE: /* } "." } ;
23
24 ARTICLE: "multiline" "Multiline"
25 "Multiline strings:"
26 { $subsections
27     POSTPONE: STRING:
28     POSTPONE: [[
29     POSTPONE: [=[
30     POSTPONE: [==[
31     POSTPONE: [===[
32     POSTPONE: [====[
33     POSTPONE: [=====[
34 }
35 "Multiline comments:"
36 { $subsections POSTPONE: /* }
37 "Writing new multiline parsing words:"
38 { $subsections parse-multiline-string }
39 ;
40
41 ABOUT: "multiline"