aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-11-25 15:17:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-25 15:17:01 +0200
commit757f42e7dea94f8b79b3d55074dedeafd853ddc5 (patch)
tree8fa27fd27e36a85a6348d85b746d49a676a27027 /doc
parenta3dad2118fb3925ef4f9baa90cea0dfd44ca93c6 (diff)
Implement literal here-document support
Diffstat (limited to 'doc')
-rw-r--r--doc/testscript.cli20
1 files changed, 16 insertions, 4 deletions
diff --git a/doc/testscript.cli b/doc/testscript.cli
index 1ba9a4b..79c6836 100644
--- a/doc/testscript.cli
+++ b/doc/testscript.cli
@@ -1421,10 +1421,22 @@ error: no such table 'no_such_table'
EOE
\
-The lines in here-document are expanded as if they were double-quoted except
-that the double quote itself is not treated as special. This means we can use
-variables and evaluation contexts in here-documents but have to escape the
-\c{\\$(} character set.
+Here-strings can be single-quoted literals or double-quoted with expansion.
+This semantics is extended to here-documents as follows. If the end marker
+on the command line is single-quoted, then the here-document lines are
+parsed as if they were single-quoted except that the single quote itself
+is not treated as special. In this mode there are no expansions, escape
+sequences, not even line continuations \- each line is taken literally.
+
+If the end marker on the command line is double-quoted, then the here-document
+lines are parsed as if they were double-quoted except that the double quote
+itself is not treated as special. In this mode we can use variables
+expansions, function calls, and evaluation contexts. However, we have to
+escape the \c{$(\\} character set.
+
+If the end marker is not quoted then it is treated as if it were
+single-quoted. Note also that quoted end markers must be quoted \i{wholly},
+that is, from the beginning and until the end and without any interruptions.
If the preceding command line starts with leading whitespaces, then the
equivalent number is stripped (if present) from each here-document line