chiark / gitweb /
tests/filter/extract-doctests: Recognise directives first
[subdirmk.git] / 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;