factor/basis/multiline/multiline-docs.factor

39 lines
1.7 KiB
Factor
Raw Normal View History

USING: help.markup help.syntax ;
IN: multiline
2007-12-11 01:39:32 -05:00
HELP: STRING:
{ $syntax "STRING: name\nfoo\n;" }
2007-12-11 01:54:16 -05:00
{ $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 preceeded 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." } ;
2007-12-11 01:39:32 -05:00
2007-12-11 17:23:56 -05:00
HELP: <"
{ $syntax "<\" text \">" }
{ $description "This forms a multiline string literal ending in \">. Unlike the " { $link POSTPONE: STRING: } " form, you can end it in the middle of a line. This construct is non-nesting. In the example above, the string would be parsed as \"text\"." } ;
2008-09-04 22:38:23 -04:00
HELP: /*
{ $syntax "/* comment */" }
{ $description "Provides C-like comments that can span multiple lines. One caveat is that " { $snippet "/*" } " and " { $snippet "*/" } " are still tokens and must not abut the comment text itself." }
{ $example "USING: multiline ;"
"/* I think that I shall never see"
" A poem lovely as a tree. */"
""
} ;
2007-12-11 17:23:56 -05:00
2008-09-04 22:38:23 -04:00
{ POSTPONE: <" POSTPONE: STRING: } related-words
2007-12-11 17:23:56 -05:00
2007-12-12 00:33:36 -05:00
HELP: parse-multiline-string
2007-12-11 17:23:56 -05:00
{ $values { "end-text" "a string delineating the end" } { "str" "the parsed string" } }
2008-09-04 22:38:23 -04:00
{ $description "Parses the input stream until the " { $snippet "end-text" } " is reached and returns the parsed text as a string." }
{ $notes "Used to implement " { $link POSTPONE: /* } " and " { $link POSTPONE: <" } "." } ;
ARTICLE: "multiline" "Multiline"
"Multiline strings:"
{ $subsection POSTPONE: STRING: }
{ $subsection POSTPONE: <" }
"Multiline comments:"
{ $subsection POSTPONE: /* }
"Writing new multiline parsing words:"
{ $subsection parse-multiline-string }
;
2007-12-11 17:23:56 -05:00
2008-09-04 22:38:23 -04:00
ABOUT: "multiline"