From 8c6b02849c6918f1deac8e463b24335844d65b86 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 25 Dec 2019 12:55:02 +0000 Subject: [PATCH 1/1] README, doctests: Use NEWQUOTE instead of STUFF 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 --- README | 14 +++++++------- tests/filter/extract-doctest | 9 +++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/README b/README index fa0fd95..4da4091 100644 --- 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 diff --git a/tests/filter/extract-doctest b/tests/filter/extract-doctest index b7da9ac..28dee5e 100755 --- a/tests/filter/extract-doctest +++ b/tests/filter/extract-doctest @@ -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} } ); -- 2.30.2