X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=blobdiff_plain;f=subdirmk%2Ftests%2Ffilter%2Fextract-doctests;fp=subdirmk%2Ftests%2Ffilter%2Fextract-doctests;h=44a94b2a001825b61d515c4aae888c78f5186172;hp=130c23705b2828968fceeacd233ec010460221b5;hb=bf60f6943fca67ea86acdcb12db34e74fe43175c;hpb=4d9d6e20e19c1aaa0d138e70897d136b36d673c0 diff --git a/subdirmk/tests/filter/extract-doctests b/subdirmk/tests/filter/extract-doctests index 130c237..44a94b2 100755 --- a/subdirmk/tests/filter/extract-doctests +++ b/subdirmk/tests/filter/extract-doctests @@ -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*)(\&$withspcs|NEWQUOTE\S+|\$)\s+(\=\>|\.\.)\s+($withspcs)\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; @@ -55,16 +55,13 @@ while (<>) { $e->{In} = $2; $e->{Out} = $4; if (# adhoc: `or ...' introduces the `at toplevel' expansion - s{^or (\S+)$}{}) { + s{^or ($withspcs)$}{}) { $e->{OutTop} = $1 eq 'nothing' ? '' : $1; } elsif (# parse: expect other wordish things to be comments m{^(?!or\b)\(?\w{2,} }) { - } elsif (# adhoc: slightly special case for $(eval $(call - m{^\$\{.*}) { - $e->{Out} .= ' '.$&; } elsif (m/^$/) { } else { - confess "unk rhs $_ ?"; + confess "unk rhs $_ (In=\"$e->{In}\" out=\"$e->{Out}\"?"; } $e->{CQ} = $in_changequote; # adhoc: rely on this specific section title @@ -147,7 +144,7 @@ sub writeout ($) { # adhoc: skip &:macro in already-doubling part return 0 if $e->{In} =~ m{^\&\:macro}; # adhoc: skip &${ ie eval in already-doubling part - return 0 if $e->{In} =~ m{^\&\$\{}; + return 0 if $e->{In} =~ m{^\&\{}; return 0 if $e->{CQ}; return $e->{DD} || !grep { # If there are two entries with the same In,