chiark / gitweb /
Syntax: Introduce &:changequote
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 Dec 2019 13:24:47 +0000 (13:24 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 28 Dec 2019 22:19:08 +0000 (22:19 +0000)
Incompatible change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
README
generate

diff --git a/README b/README
index 3390adf..006b57f 100644 (file)
--- a/README
+++ b/README
@@ -266,11 +266,11 @@ So pathname syntax is a subset of:
 &#     delete everything to end of line
        (useful if the RHS contains unrecognised & constructions)
 
-&!STUFF
+&:changequote STUFF
        changes the escape sequence from & to literally STUFF
        STUFF may be any series of of non-whitespace characters,
-       and is terminated by EOL or lwsp.  &!STUFF and the lwsp
-       are discarded.
+       and is terminated by EOL or lwsp.  The whole line is
+       discarded.
 
        After this, write STUFF instead of &, everywhere.
        The effect is global and lasts until the next setting.
@@ -278,9 +278,9 @@ So pathname syntax is a subset of:
        it back before using &:include.
 
        Notably
-               STUFFSTUFF      =>      STUFFSTUFF
-               \STUFF          =>      STUFF
-               STUFF!&         set escape back to &
+               STUFFSTUFF              => STUFFSTUFF
+               \STUFF                  => STUFF
+               STUFF:changequote &     => set escape back to &
 
 &TARGETS_things
        Handled specially.  If mentioned, declares that this
index c17d5f7..351926b 100755 (executable)
--- a/generate
+++ b/generate
@@ -176,9 +176,6 @@ sub process_input_mk ($$$$$$$$) {
            } elsif (s{^![ \t]+}{}) {
                o $_;
                $_ = '';
-           } elsif (s{^!(\S+)(?:[ \t]+|$)}{}) {
-               $$esclitr = $1;
-               $set_esc->();
            } else {
                die "bad escape $$esclitr$_ ";
            }
@@ -192,6 +189,9 @@ sub process_input_mk ($$$$$$$$) {
                                 $var_prefix, $targets,
                                 $subf, $esclitr, $1);
                o "\n";
+           } elsif (m#^changequote\s+(\S+)\s+$#) {
+               $$esclitr = $1;
+               $set_esc->();
            } else {
                die "unknown directive $_ ";
            }