From 7a92c91b6dd75054c0eedeb660bd160322f0ad28 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 4 Jun 2017 16:15:38 -0500 Subject: [PATCH] multiline: HEREDOC: -> heredoc: --- basis/multiline/multiline-docs.factor | 12 ++++++------ basis/multiline/multiline-tests.factor | 26 +++++++++++++------------- basis/multiline/multiline.factor | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/basis/multiline/multiline-docs.factor b/basis/multiline/multiline-docs.factor index 93d2857899..c6ce2794f2 100644 --- a/basis/multiline/multiline-docs.factor +++ b/basis/multiline/multiline-docs.factor @@ -16,18 +16,18 @@ HELP: /* } } ; -HELP: HEREDOC: -{ $syntax "HEREDOC: marker\n...text...\nmarker" } +HELP: heredoc: +{ $syntax "heredoc: marker\n...text...\nmarker" } { $values { "marker" "a word (token)" } { "text" "arbitrary text" } { "value" string } } -{ $description "Returns a string delimited by an arbitrary user-defined token. This delimiter must be exactly the text beginning at the first non-blank character after " { $link postpone: HEREDOC: } " until the end of the line containing " { $link postpone: HEREDOC: } ". Text is captured until a line is found containing exactly this delimiter string." } +{ $description "Returns a string delimited by an arbitrary user-defined token. This delimiter must be exactly the text beginning at the first non-blank character after " { $link postpone: heredoc: } " until the end of the line containing " { $link postpone: heredoc: } ". Text is captured until a line is found containing exactly this delimiter string." } { $warning "Whitespace is significant." } { $examples { $example "USING: multiline prettyprint ;" - "HEREDOC: END\nx\nEND\n." + "heredoc: END\nx\nEND\n." "\"x\\n\"" } { $example "USING: multiline prettyprint sequences ;" - "2 5 HEREDOC: zap\nfoo\nbar\nzap\nsubseq ." + "2 5 heredoc: zap\nfoo\nbar\nzap\nsubseq ." "\"o\\nb\"" } } ; @@ -41,7 +41,7 @@ ARTICLE: "multiline" "Multiline" "Multiline strings:" { $subsections postpone: STRING: - postpone: HEREDOC: + postpone: heredoc: } "Multiline comments:" { $subsections postpone: /* } diff --git a/basis/multiline/multiline-tests.factor b/basis/multiline/multiline-tests.factor index dbc2688f4e..846c67c746 100644 --- a/basis/multiline/multiline-tests.factor +++ b/basis/multiline/multiline-tests.factor @@ -10,62 +10,62 @@ bar { "foo\nbar\n" } [ test-it ] unit-test -! HEREDOC: +! heredoc: -{ "foo\nbar\n" } [ HEREDOC: END +{ "foo\nbar\n" } [ heredoc: END foo bar END ] unit-test -{ "" } [ HEREDOC: END +{ "" } [ heredoc: END END ] unit-test -{ " END\n" } [ HEREDOC: END +{ " END\n" } [ heredoc: END END END ] unit-test -{ "\n" } [ HEREDOC: END +{ "\n" } [ heredoc: END END ] unit-test -{ "x\n" } [ HEREDOC: END +{ "x\n" } [ heredoc: END x END ] unit-test -{ "x\n" } [ HEREDOC: END +{ "x\n" } [ heredoc: END x END ] unit-test ! there's a space after xyz -{ "xyz \n" } [ HEREDOC: END +{ "xyz \n" } [ heredoc: END xyz END ] unit-test -{ "} ! * # \" «\n" } [ HEREDOC: END +{ "} ! * # \" «\n" } [ heredoc: END } ! * # " « END ] unit-test -{ 21 "foo\nbar\n" " HEREDOC: FOO\n FOO\n" 22 } [ 21 HEREDOC: X +{ 21 "foo\nbar\n" " heredoc: FOO\n FOO\n" 22 } [ 21 heredoc: X foo bar X -HEREDOC: END - HEREDOC: FOO +heredoc: END + heredoc: FOO FOO END 22 ] unit-test { "lol\n xyz\n" } [ -HEREDOC: xyz +heredoc: xyz lol xyz xyz diff --git a/basis/multiline/multiline.factor b/basis/multiline/multiline.factor index 5a631c0285..a9e35ef12a 100644 --- a/basis/multiline/multiline.factor +++ b/basis/multiline/multiline.factor @@ -84,7 +84,7 @@ PRIVATE> SYNTAX: /* "*/" parse-multiline-string drop ; -SYNTAX: HEREDOC: +SYNTAX: heredoc: lexer get { [ skip-blank ] [ rest-of-line ]