summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeb <unknown>2005-02-16 10:33:05 +0000
committerpeb <unknown>2005-02-16 10:33:05 +0000
commit55f889eda88d847ace5cdae00b175434006be287 (patch)
treebcfeb5bcd9551dfa1e9434ec1134b5b715038cf1 /src
parentf8df4df53065fdafc76306e20e5e12b335254042 (diff)
"Committed_by_peb"
Diffstat (limited to 'src')
-rw-r--r--src/haddock/haddock-check.perl16
1 files 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;
}