chiark / gitweb /
tests/filter/extract-doctests: Recognise directives first
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jan 2020 13:49:01 +0000 (13:49 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jan 2020 13:59:41 +0000 (13:59 +0000)
We are going to expand the rules for => expansions and they would
match directives too, but we don't want them to.

No functional change with existing input.

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

index e4141e68f060816d8a6d29a927042f7bf10eba2c..d16aa6cfbee296073d3a5be0b0758d0faad67257 100755 (executable)
@@ -45,9 +45,9 @@ while (<>) {
     next unless m{\=\>} or ($cent and m{ \.\. });
     my $mapop = '=>';
     # 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)$}{}) {
+    if (s{^()(\&\:\w+(?: \S+)*)\s{2,}(\=\>)\s{2,}($withspcs)$}{} ||
+        s{^(\s*)(\&\S+|NEWQUOTE\S+|\$)\s+(\=\>|\.\.)\s+(\S+)\s+}{} ||
+       $cent && s{^()($withspcs)\s{2,}(\.\.)\s{2,}($withspcs)$}{}) {
        # adhoc: expected indented iff in changequote part
        confess if length($1) xor $in_changequote;
        $mapop = $3;