summaryrefslogtreecommitdiff
path: root/src/haddock/haddock-check.perl
diff options
context:
space:
mode:
authorpeb <unknown>2005-02-11 06:08:28 +0000
committerpeb <unknown>2005-02-11 06:08:28 +0000
commit40aed94124b0fc12f9846efddb09df2bba1f25c8 (patch)
treed200eeaf2a9eaad9cc47de3a5961321fb9037953 /src/haddock/haddock-check.perl
parentd676355271f360861b8462c4b788202ddd605b6d (diff)
"Committed_by_peb"
Diffstat (limited to 'src/haddock/haddock-check.perl')
-rw-r--r--src/haddock/haddock-check.perl21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/haddock/haddock-check.perl b/src/haddock/haddock-check.perl
index cea2a6cb1..a7f591cba 100644
--- a/src/haddock/haddock-check.perl
+++ b/src/haddock/haddock-check.perl
@@ -2,7 +2,7 @@
# checking that a file is haddocky
# limitations:
-# - does not check that 'type' declarations really are put in the export list
+# - does not check that type aliases are put in the export list
# - there might be some problems with nested comments
for $file (@ARGV) {
@@ -14,30 +14,39 @@ for $file (@ARGV) {
# print "- $file\n";
- # removing comments:
+ # removing comments
s/\{-.*?-\}//gs;
s/--.*?\n/\n/g;
- # export list:
+ # export list
if (/\nmodule\s+(\w+)\s+\((.*?)\)\s+where/s) {
($module, $exportlist) = ($1, $2);
- # removing modules from exportlist:
+ # removing modules from exportlist
$exportlist =~ s/module\s+[A-Z]\w*//gs;
- # type signatures:
+ # type signatures
while (/\n([a-z]\w*)\s*::/gs) {
$function = $1;
$exportlist =~ s/\b$function\b//;
}
+ # type aliases
+ while (/\ntype\s+(\w+)/gs) {
+ $type = $1;
+ next if $exportlist =~ /\b$type\b/;
+ printf "%-30s | Type alias not in export list: %s\n", $file, $type;
+ }
+
+ # exported functions without type signatures
while ($exportlist =~ /\b(\w+)\b/gs) {
$function = $1;
next if $function =~ /^[A-Z]/;
- printf "%-30s | No type signature for '%s'\n", $file, $1;
+ printf "%-30s | No type signature for function: %s\n", $file, $function;
}
} else {
+ # modules without export lists
printf "%-30s | No export list\n", $file;
}