diff --git a/extra/multiline/multiline-docs.factor b/extra/multiline/multiline-docs.factor index 15d3ead705..d2d9c7967f 100644 --- a/extra/multiline/multiline-docs.factor +++ b/extra/multiline/multiline-docs.factor @@ -2,7 +2,7 @@ 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." } ; +{ $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." } ; IN: multiline ABOUT: POSTPONE: STRING: diff --git a/extra/multiline/multiline-tests.factor b/extra/multiline/multiline-tests.factor new file mode 100644 index 0000000000..5ef289f4c3 --- /dev/null +++ b/extra/multiline/multiline-tests.factor @@ -0,0 +1,9 @@ +USING: multiline tools.test ; + +STRING: test-it +foo +bar + +; + +[ "foo\nbar\n" ] [ test-it ] unit-test diff --git a/extra/multiline/multiline.factor b/extra/multiline/multiline.factor index e55112a5f0..1229dcc689 100644 --- a/extra/multiline/multiline.factor +++ b/extra/multiline/multiline.factor @@ -11,7 +11,7 @@ IN: multiline [ drop lexer get next-line ] [ % "\n" % (parse-here) ] if ; : parse-here ( -- str ) - [ (parse-here) ] "" make + [ (parse-here) ] "" make 1 head* lexer get next-line ; : STRING: