diff options
Diffstat (limited to 'admin/check-doc-strings')
| -rwxr-xr-x | admin/check-doc-strings | 57 |
1 files changed, 49 insertions, 8 deletions
diff --git a/admin/check-doc-strings b/admin/check-doc-strings index 63856d32871..135090b34ce 100755 --- a/admin/check-doc-strings +++ b/admin/check-doc-strings | |||
| @@ -59,7 +59,7 @@ sub Check_texi_function { | |||
| 59 | $arglist_parm{$parm} = 1; | 59 | $arglist_parm{$parm} = 1; |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | foreach my $parm ($docstring =~ /\@var{([^{}]+)}/g) { | 62 | foreach my $parm ($docstring =~ /\@var\{([^{}]+)\}/g) { |
| 63 | $docstring_parm{$parm} = 1; | 63 | $docstring_parm{$parm} = 1; |
| 64 | } | 64 | } |
| 65 | 65 | ||
| @@ -111,7 +111,9 @@ sub Check_function { | |||
| 111 | # $arglist_parm{$parm} = 1; | 111 | # $arglist_parm{$parm} = 1; |
| 112 | #} | 112 | #} |
| 113 | foreach my $parm (@parms) { | 113 | foreach my $parm (@parms) { |
| 114 | next if $parm eq '&optional' || $parm eq '&rest'; | 114 | next if $parm eq '&optional' |
| 115 | || $parm eq '&rest' | ||
| 116 | || $parm eq 'Lisp-Object'; | ||
| 115 | $arglist_parm{$parm} = 1; | 117 | $arglist_parm{$parm} = 1; |
| 116 | } | 118 | } |
| 117 | my $doc_tmp = $docstring; | 119 | my $doc_tmp = $docstring; |
| @@ -150,6 +152,22 @@ sub Check_function { | |||
| 150 | next if $parm eq 'primary'; | 152 | next if $parm eq 'primary'; |
| 151 | next if $parm eq 'secondary'; | 153 | next if $parm eq 'secondary'; |
| 152 | next if $parm eq 'clipboard'; | 154 | next if $parm eq 'clipboard'; |
| 155 | next if $parm eq 'bbdb'; | ||
| 156 | next if $parm eq 'dos'; | ||
| 157 | next if $parm eq 'erc'; | ||
| 158 | next if $parm eq 'exif'; | ||
| 159 | next if $parm eq 'ldap'; | ||
| 160 | next if $parm eq 'ime'; | ||
| 161 | next if $parm eq 'rfc'; | ||
| 162 | next if $parm eq 'ms-dos'; | ||
| 163 | next if $parm eq 'url'; | ||
| 164 | next if $parm eq 'w32'; | ||
| 165 | next if $parm eq 'todo'; # org-mode | ||
| 166 | next if $parm eq 'done'; # org-mode | ||
| 167 | next if $parm eq 'waiting'; #org-mode | ||
| 168 | next if $parm eq 'ordered'; #org-mode | ||
| 169 | next if $parm eq 'deadline'; #org-mode | ||
| 170 | next if $parm eq 'scheduled'; #org-mode | ||
| 153 | next if length $parm < 3; | 171 | next if length $parm < 3; |
| 154 | if (! exists $arglist_parm{$parm}) { | 172 | if (! exists $arglist_parm{$parm}) { |
| 155 | print "bogus parm: $function: $parm\n"; | 173 | print "bogus parm: $function: $parm\n"; |
| @@ -228,20 +246,43 @@ open (FIND, "find src -name '*.c' -print |") or die; | |||
| 228 | while (my $file = <FIND>) { | 246 | while (my $file = <FIND>) { |
| 229 | my @matches = | 247 | my @matches = |
| 230 | ((FileContents $file) =~ | 248 | ((FileContents $file) =~ |
| 231 | /\bDEFUN\s*\(\s*\"((?:[^\\\"]|\\.)+)\"\s*,\s*\S+\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*((?:0|\"(?:(?:[^\\\"]|\\.)*)\"))\s*,\s*\/\*(.*?)\*\/\s*\(([^()]*)\)\)/sgo); | 249 | /\b |
| 250 | DEFUN\s*\(\s* | ||
| 251 | ## $function | ||
| 252 | \"((?:[^\\\"]|\\.)+)\"\s*, | ||
| 253 | \s*\S+\s*, \s*\S+\s*, | ||
| 254 | ## $minargs | ||
| 255 | \s*(\S+)\s*, | ||
| 256 | ## $maxargs | ||
| 257 | \s*(\S+)\s*, | ||
| 258 | ## $interactive | ||
| 259 | \s*((?:0|\"(?:(?:[^\\\"]|\\.)*)\"))\s*, | ||
| 260 | ## $docstring | ||
| 261 | \s*doc:\s*\/\*\s*(.*?)\s*\*\/ | ||
| 262 | # attributes -- skip | ||
| 263 | (?:\s*attributes:\s* | ||
| 264 | (?:noreturn|const) | ||
| 265 | \s*)? | ||
| 266 | \s*\) | ||
| 267 | ### $parms | ||
| 268 | \s*\( | ||
| 269 | ([^()]*) | ||
| 270 | \) | ||
| 271 | /sgox); | ||
| 232 | while (@matches) { | 272 | while (@matches) { |
| 233 | my ($function, $minargs, $maxargs, $interactive, $docstring, $parms) = splice (@matches, 0, 6); | 273 | my ($function, $minargs, $maxargs, $interactive, $docstring, $parms) = splice (@matches, 0, 6); |
| 234 | $docstring =~ s/^\n+//s; | 274 | $docstring =~ s/^\n+//s; |
| 235 | $docstring =~ s/\n+$//s; | 275 | $docstring =~ s/\n+$//s; |
| 236 | $parms =~ s/,/ /g; | 276 | $parms =~ s/,/ /g; |
| 237 | my @parms = split (' ',$parms); | 277 | my @parms = $parms eq 'void' ? () : split (' ', $parms); |
| 238 | for (@parms) { tr/_/-/; s/-$//; } | 278 | for (@parms) { tr/_/-/; s/-$//; } |
| 239 | if ($parms !~ /Lisp_Object/) { | 279 | if ($parms !~ /Lisp_Object/) { |
| 240 | if ($minargs < @parms) { | 280 | if ($minargs < @parms) { |
| 241 | if ($maxargs =~ /^\d+$/) { | 281 | if ($maxargs =~ /^\d+$/) { |
| 242 | die unless $maxargs eq @parms; | 282 | die "$function: $maxargs" |
| 243 | splice (@parms, $minargs, 0, '&optional'); | 283 | unless $maxargs eq @parms; |
| 244 | } | 284 | splice (@parms, $minargs, 0, '&optional'); |
| 285 | } | ||
| 245 | } | 286 | } |
| 246 | } | 287 | } |
| 247 | my $funtype = ($interactive =~ /\"/ ? 'Command' : 'Function'); | 288 | my $funtype = ($interactive =~ /\"/ ? 'Command' : 'Function'); |