chiark / gitweb /
README, doctests: Use NEWQUOTE instead of STUFF
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 25 Dec 2019 12:55:02 +0000 (12:55 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 28 Dec 2019 22:19:08 +0000 (22:19 +0000)
STUFF is rather generic.  Also we want to seddery it in the rubric for
the doctest to avoid it triggering.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
README
tests/filter/extract-doctest

diff --git a/README b/README
index fa0fd95..4da4091 100644 (file)
--- a/README
+++ b/README
@@ -274,21 +274,21 @@ So pathname syntax is a subset of:
 &#     delete everything to end of line
        (useful if the RHS contains unrecognised & constructions)
 
-&:changequote STUFF
-       changes the escape sequence from & to literally STUFF
-       STUFF may be any series of of non-whitespace characters,
+&:changequote NEWQUOTE
+       changes the escape sequence from & to literally NEWQUOTE
+       NEWQUOTE may be any series of of non-whitespace characters,
        and is terminated by EOL or lwsp.  The whole line is
        discarded.
 
-       After this, write STUFF instead of &, everywhere.
+       After this, write NEWQUOTE instead of &, everywhere.
        The effect is global and lasts until the next setting.
        It takes effect on &:include'd files too, so maybe set
        it back before using &:include.
 
        Notably
-               STUFFSTUFF              => STUFFSTUFF
-               STUFF\STUFF             => STUFF
-               STUFF:changequote &     set escape back to &
+               NEWQUOTENEWQUOTE        => NEWQUOTENEWQUOTE
+               NEWQUOTE\NEWQUOTE       => NEWQUOTE
+               NEWQUOTE:changequote &  set escape back to &
 
 &TARGETS_things
        Handled specially.  If mentioned, declares that this
index b7da9ac..28dee5e 100755 (executable)
@@ -41,8 +41,8 @@ while (<>) {
     # parse: rely on looking for => (and .. on subsequent lines)
     next unless m{\=\>} or ($cent and m{ \.\. });
     my $mapop = '=>';
-    # adhoc: special case STUFF here so we recognise things in changequote
-    if (s{^(\s*)(\&\S+|STUFF\S+|\$)\s+(\=\>|\.\.)\s+(\S+)\s+}{} ||
+    # adhoc: special case NEWQUOTE here so we recognise things in changequote
+    if (s{^(\s*)(\&\S+|NEWQUOTE\S+|\$)\s+(\=\>|\.\.)\s+(\S+)\s+}{} ||
        s{^()(\&\:\w+(?: \S+)*)\s{2,}(\=\>)\s{2,}($withspcs)$}{} ||
         $cent && s{^()($withspcs)\s{2,}(\.\.)\s{2,}($withspcs)$}{}) {
        # adhoc: expected indented iff in changequote part
@@ -104,6 +104,7 @@ sub write_permode ($$$$$;$$) {
        my $rubric = $e->{In};
        $rubric =~ s/\&/AMP /g;
        $rubric =~ s/\$/DOLLAR /g;
+       $rubric =~ s/NEWQUOTE/NEW_QUOTE /g;
        my $f = $e->{In} =~ m/\n/
                ? "\n# %s:\n%s\n\n"
                : "%-30s: %s.\n";
@@ -128,8 +129,8 @@ sub writeout ($) {
                  '','','', 'normal',
                 sub { !$_[0]{CQ} } );
     write_permode($dir_prefix,
-                 "&:changequote STUFF",
-                 "STUFF:changequote &",
+                 "&:changequote NEWQUOTE",
+                 "NEWQUOTE:changequote &",
                  "\n",
                  'changequote',
                  sub { $_[0]{CQ} } );