You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (not /\A\/\*\*\s*\Z/) { # not doxygen comment start?
308
+
my$decl;
309
+
my@templines;
310
+
my$str;
311
+
my$has_doxygen = 1;
312
+
if (/\A\s*extern\s+DECLSPEC/) { # a function declaration without a doxygen comment?
313
+
@templines = ();
314
+
$decl = $_;
315
+
$str = '';
316
+
$has_doxygen = 0;
317
+
} elsif (not /\A\/\*\*\s*\Z/) { # not doxygen comment start?
308
318
push@contents, $_;
309
319
next;
310
-
}
311
-
312
-
my@templines = ();
313
-
push@templines, $_;
314
-
my$str = '';
315
-
while (<FH>) {
316
-
chomp;
317
-
push@templines, $_;
318
-
lastif/\A\s*\*\/\Z/;
319
-
if (s/\A\s*\*\s*\`\`\`/```/) { # this is a hack, but a lot of other code relies on the whitespace being trimmed, but we can't trim it in code blocks...
320
-
$str .= "$_\n";
321
-
while (<FH>) {
322
-
chomp;
323
-
push@templines, $_;
324
-
s/\A\s*\*\s?//;
325
-
if (s/\A\s*\`\`\`/```/) {
326
-
$str .= "$_\n";
327
-
last;
328
-
} else {
329
-
$str .= "$_\n";
320
+
} else { # Start of a doxygen comment, parse it out.
321
+
@templines = ( $_ );
322
+
while (<FH>) {
323
+
chomp;
324
+
push@templines, $_;
325
+
lastif/\A\s*\*\/\Z/;
326
+
if (s/\A\s*\*\s*\`\`\`/```/) { # this is a hack, but a lot of other code relies on the whitespace being trimmed, but we can't trim it in code blocks...
327
+
$str .= "$_\n";
328
+
while (<FH>) {
329
+
chomp;
330
+
push@templines, $_;
331
+
s/\A\s*\*\s?//;
332
+
if (s/\A\s*\`\`\`/```/) {
333
+
$str .= "$_\n";
334
+
last;
335
+
} else {
336
+
$str .= "$_\n";
337
+
}
330
338
}
339
+
} else {
340
+
s/\A\s*\*\s*//;
341
+
$str .= "$_\n";
331
342
}
332
-
} else {
333
-
s/\A\s*\*\s*//;
334
-
$str .= "$_\n";
335
343
}
336
-
}
337
344
338
-
my$decl = <FH>;
339
-
chomp($decl);
340
-
if (not$decl =~ /\A\s*extern\s+DECLSPEC/) {
341
-
#print "Found doxygen but no function sig:\n$str\n\n";
342
-
foreach (@templines) {
343
-
push@contents, $_;
345
+
$decl = <FH>;
346
+
$decl = ''ifnotdefined$decl;
347
+
chomp($decl);
348
+
if (not$decl =~ /\A\s*extern\s+DECLSPEC/) {
349
+
#print "Found doxygen but no function sig:\n$str\n\n";
350
+
foreach (@templines) {
351
+
push@contents, $_;
352
+
}
353
+
push@contents, $decl;
354
+
next;
344
355
}
345
-
push@contents, $decl;
346
-
next;
347
356
}
348
357
349
358
my@decllines = ( $decl );
@@ -397,6 +406,7 @@ sub usage {
397
406
$headerdecls{$fn} = $decl;
398
407
$headerfuncslocation{$fn} = $dent;
399
408
$headerfuncschunk{$fn} = scalar(@contents);
409
+
$headerfuncshasdoxygen{$fn} = $has_doxygen;
400
410
401
411
push@contents, join("\n", @templines);
402
412
push@contents, join("\n", @decllines);
@@ -522,7 +532,6 @@ sub usage {
522
532
523
533
$wordwrap_mode = 'md'; # the headers use Markdown format.
524
534
525
-
# if it's not in the headers already, we don't add it, so iterate what we know is already there for changes.
526
535
foreach (keys%headerfuncs) {
527
536
my$fn = $_;
528
537
nextifnotdefined$wikifuncs{$fn}; # don't have a page for that function, skip it.
@@ -537,6 +546,8 @@ sub usage {
537
546
my$addblank = 0;
538
547
my$str = '';
539
548
549
+
$headerfuncshasdoxygen{$fn} = 1; # Added/changed doxygen for this header.
550
+
540
551
$brief = dewikify($wikitype, $brief);
541
552
$brief =~ s/\A(.*?\.) /$1\n/; # \brief should only be one sentence, delimited by a period+space. Split if necessary.
my$wikitype = defined$wikitypes{$fn} ? $wikitypes{$fn} : 'mediawiki'; # default to MediaWiki for new stuff FOR NOW.
674
706
die("Unexpected wikitype '$wikitype'\n") if (($wikitypene'mediawiki') and ($wikitypene'md'));
675
707
@@ -678,6 +710,7 @@ sub usage {
678
710
$wordwrap_mode = $wikitype;
679
711
680
712
my$raw = $headerfuncs{$fn}; # raw doxygen text with comment characters stripped from start/end and start of each line.
713
+
nextifnotdefined$raw;
681
714
$raw =~ s/\A\s*\\brief\s+//; # Technically we don't need \brief (please turn on JAVADOC_AUTOBRIEF if you use Doxygen), so just in case one is present, strip it.
0 commit comments