From 55f889eda88d847ace5cdae00b175434006be287 Mon Sep 17 00:00:00 2001 From: peb Date: Wed, 16 Feb 2005 10:33:05 +0000 Subject: [PATCH] "Committed_by_peb" --- src/haddock/haddock-check.perl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/haddock/haddock-check.perl b/src/haddock/haddock-check.perl index a7f591cba..57e311ed2 100644 --- a/src/haddock/haddock-check.perl +++ b/src/haddock/haddock-check.perl @@ -5,6 +5,9 @@ # - does not check that type aliases are put in the export list # - there might be some problems with nested comments +$operSym = qr/[\!\#\$\%\&\*\+\.\/\<\=\>\?\@\\\^\|\-\~\:]+/; +$funSym = qr/[a-z]\w*\'*/; + for $file (@ARGV) { $file =~ s/\.hs//; @@ -26,11 +29,18 @@ for $file (@ARGV) { $exportlist =~ s/module\s+[A-Z]\w*//gs; # type signatures - while (/\n([a-z]\w*)\s*::/gs) { + while (/\n($funSym)\s*::/gs) { $function = $1; + # print "- $function\n"; $exportlist =~ s/\b$function\b//; } + while (/\n(\($operSym\))\s*::/gs) { + $function = $1; + # print ": $function\n"; + $exportlist =~ s/\Q$function\E//; + } + # type aliases while (/\ntype\s+(\w+)/gs) { $type = $1; @@ -39,9 +49,11 @@ for $file (@ARGV) { } # exported functions without type signatures - while ($exportlist =~ /\b(\w+)\b/gs) { + while ($exportlist =~ /(\b$funSym\b|\($operSym\))/gs) { $function = $1; + # print "+ $function\n"; next if $function =~ /^[A-Z]/; + next if $function =~ /^\((\.\.|\:\:?|\=|\\|\||\<\-|\-\>|\@|\~|\=\>)\)$/; printf "%-30s | No type signature for function: %s\n", $file, $function; }