--- /dev/null
+USING: help.markup help.syntax multiline ;
+
+HELP: STRING:
+{ $syntax "STRING: name\nfoo\n;" }
+{ $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 and at the end." } ;
+
+IN: multiline
+ABOUT: POSTPONE: STRING:
--- /dev/null
+! Copyright (C) 2007 Daniel Ehrenberg
+! See http://factorcode.org/license.txt for BSD license.
+USING: namespaces parser kernel sequences words quotations ;
+IN: multiline
+
+: next-line-text ( -- str )
+ lexer get dup next-line line-text ;
+
+: (parse-here) ( -- )
+ next-line-text dup ";" =
+ [ drop lexer get next-line ] [ % "\n" % (parse-here) ] if ;
+
+: parse-here ( -- str )
+ [ (parse-here) ] "" make
+ lexer get next-line ;
+
+: STRING:
+ CREATE dup reset-generic
+ parse-here 1quotation define-compound ; parsing