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 fa0fd95e146689deca5551096cb794a5c8ee8b86..4da40911ce83909e880874de657b6d4db797992b 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)
 
 &#     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.
 
        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
        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
 
 &TARGETS_things
        Handled specially.  If mentioned, declares that this
index b7da9ac72d3701d1b429b3346a90b95a72613c00..28dee5ec7a4942cfd7f31f306fbea6c1f3c907ea 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 = '=>';
     # 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
        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;
        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";
        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,
                  '','','', 'normal',
                 sub { !$_[0]{CQ} } );
     write_permode($dir_prefix,
-                 "&:changequote STUFF",
-                 "STUFF:changequote &",
+                 "&:changequote NEWQUOTE",
+                 "NEWQUOTE:changequote &",
                  "\n",
                  'changequote',
                  sub { $_[0]{CQ} } );
                  "\n",
                  'changequote',
                  sub { $_[0]{CQ} } );