diff options
| author | peb <unknown> | 2005-03-29 10:17:53 +0000 |
|---|---|---|
| committer | peb <unknown> | 2005-03-29 10:17:53 +0000 |
| commit | 67aa6e7a81d8d22ff8409ed59fab7bacde2312a6 (patch) | |
| tree | 1759bd8e1b314e2b98ffb0a6116e2a1fb515908d /src/haddock | |
| parent | ccf6017b030fcefd5964979f1b6d55e722616ef7 (diff) | |
"Committed_by_peb"
Diffstat (limited to 'src/haddock')
| -rw-r--r-- | src/haddock/haddock-check.perl | 27 | ||||
| -rw-r--r-- | src/haddock/haddock-script.csh | 6 |
2 files changed, 22 insertions, 11 deletions
diff --git a/src/haddock/haddock-check.perl b/src/haddock/haddock-check.perl index 5ff9e1a10..fa1dae941 100644 --- a/src/haddock/haddock-check.perl +++ b/src/haddock/haddock-check.perl @@ -31,17 +31,19 @@ sub check_headerline { if (s/^-- \s $title \s* : \s+ (.+?) \s*\n//sx) { $name = $1; print " > Incorrect ".lcfirst $title.": $name\n" unless $name =~ $regexp; + return $&; } else { - print " > Header missing".lcfirst $title."\n"; + print " > Header missing: ".lcfirst $title."\n"; } } if ($#ARGV >= 0) { @FILES = @ARGV; } else { - @dirs = qw/. api canonical cf cfgm compile for-ghc-nofud - grammar infra newparsing notrace parsers shell - source speech translate useGrammar util visualization/; + @dirs = qw{. api canonical cf cfgm compile for-ghc-nofud + grammar infra notrace parsers shell + source speech translate useGrammar util visualization + GF GF/* GF/*/*}; @FILES = grep(!/\/(Par|Lex)(GF|GFC|CFG)\.hs$/, glob "{".join(",",@dirs)."}/*.hs"); } @@ -65,11 +67,13 @@ for $file (@FILES) { } # the module header + $hdr_module = $module = ""; + s/^ (--+ \s* \n) +//sx; unless (s/^ -- \s \| \s* \n//sx) { print " > Incorrect module header\n"; } else { - &check_headerline("Module", qr/^ [A-Z] \w* $/x); + $hdr_module = s/^-- \s Module \s* : \s+ (.+?) \s*\n//sx ? $1 : ""; &check_headerline("Maintainer", qr/^ [\wåäöÅÄÖüÜ\s\@\.]+ $/x); &check_headerline("Stability", qr/.*/); &check_headerline("Portability", qr/.*/); @@ -77,7 +81,7 @@ for $file (@FILES) { print " > Missing CVS information\n" unless s/^(-- \s+ \> \s+ CVS \s+ \$ .*? \$ \s* \n)+//sx; s/^ (--+ \s* \n) +//sx; - print " > Missing module description\n" + print " > Missing module description\n" unless /^ -- \s+ [^\(]/x; } @@ -91,13 +95,15 @@ for $file (@FILES) { # the export list $exportlist = ""; - if (/\n module \s+ (\w+) \s+ \( (.*?) \) \s+ where/sx) { + if (/\n module \s+ ((?: \w | \.)+) \s+ \( (.*?) \) \s+ where/sx) { ($module, $exportlist) = ($1, $2); $exportlist =~ s/\b module \s+ [A-Z] \w*//gsx; $exportlist =~ s/\(\.\.\)//g; - } else { + } elsif (/\n module \s+ ((?: \w | \.)+) \s+ where/sx) { + $module = $1; + # modules without export lists print " > No export list\n"; @@ -120,8 +126,13 @@ for $file (@FILES) { $exportlist .= " $fn "; } + } else { + print " > No module header found\n"; } + print " > Module names not matching: $module != $hdr_module\n" + if $hdr_module && $module !~ /\Q$hdr_module\E$/; + # fixing exportlist (double spaces as separator) $exportlist = " $exportlist "; $exportlist =~ s/(\s | \,)+/ /gx; diff --git a/src/haddock/haddock-script.csh b/src/haddock/haddock-script.csh index dd96a0f88..289f3a3a3 100644 --- a/src/haddock/haddock-script.csh +++ b/src/haddock/haddock-script.csh @@ -2,8 +2,8 @@ ###################################################################### # Author: Peter Ljunglöf -# Time-stamp: "2005-02-18, 14:26" -# CVS $Date: 2005/02/18 19:21:06 $ +# Time-stamp: "2005-03-22, 06:24" +# CVS $Date: 2005/03/29 11:17:54 $ # CVS $Author: peb $ # # a script for producing documentation through Haddock @@ -15,7 +15,7 @@ set resourcedir = $base/haddock-resources #set dirs = (. api compile grammar infra shell source canonical useGrammar cf newparsing parsers notrace cfgm speech visualization for-hugs for-ghc) -set files = (`find $base -name '*.hs' -not -path '*/conversions/*' -not -path '*/parsing/*' -not -path '*/for-*' -not -path '*/haddock*' -not -name 'Lex[GC]*' -not -name 'Par[GC]*'` $base/for-ghc-nofud/*.hs) +set files = (`find $base -name '*.hs' -not -path '*/old-stuff/*' -not -path '*/for-*' -not -path '*/haddock*' -not -name 'Lex[GC]*' -not -name 'Par[GC]*'` $base/for-ghc-nofud/*.hs) ###################################################################### |
