X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=docs%2Fexdoc;h=92027663e6d6f7244b55fdcf8fa4f33a05f504c8;hb=098e88f3a87205d92516a1fe912b6f84164d0a59;hp=64aa85fdf442a255d5c864f8daa61e2e84c872a9;hpb=9cad7ff740962a8be9db82281f62af4d28759911;p=mono.git diff --git a/docs/exdoc b/docs/exdoc index 64aa85fdf44..92027663e6d 100644 --- a/docs/exdoc +++ b/docs/exdoc @@ -149,10 +149,13 @@ sub process_function { # Process formatting within sections. for my $parameter (@parameters) { - process_formatting(\$parameter->{description}); + process_formatting(\$parameter->{description}, $file_path, $.); + } + process_formatting(\$returns, $file_path, $.); + process_formatting(\$body, $file_path, $.); + if (defined($deprecated)) { + process_formatting(\$deprecated, $file_path, $.); } - process_formatting(\$returns); - process_formatting(\$body); $body =~ s/\n/ /g; if (exists($docs->{body}->{$name})) { @@ -181,19 +184,29 @@ sub process_function { $_ = '
' if /^\s*$/;
if ($section == $PARAMETER_SECTION) {
- if (/\s*(\w+):(.*)/) {
+ if (/\s*\\param +(\w+)(.*)/) {
+ # print "$file_path:$.: warning: Got parameter $1\n";
+ push @parameters, { name => $1, description => $2 };
+ } elsif (/\s*\\deprecated(.*)/) {
+ # print "$file_path:$.: warning: Got deprecated annotation\n";
+ $deprecated = $1;
+ } elsif (/\s*(\w+):(.*)/) {
if ($1 eq 'deprecated') {
+ warn "$file_path:$.: Old-style monodoc notation 'deprecated:' used\n"
+ if $WARNINGS;
$deprecated = $2;
} else {
+ warn "$file_path:$.: Old-style monodoc notation 'param:' used\n"
+ if $WARNINGS;
push @parameters, { name => $1, description => $2 };
}
} else {
- $body = "\t$_\n";
+ # $body = "\t$_\n";
$section = $BODY_SECTION;
+ redo;
}
} elsif ($section == $BODY_SECTION) {
- if (/Returns?:/) {
- s/Returns?://;
+ if (s/(Returns?:\s*|\\returns?\s*)//) {
$returns = "\t$_\n";
$section = $RETURN_SECTION;
} else {
@@ -211,7 +224,7 @@ sub process_function {
# Substitute formatting within documentation text.
#
sub process_formatting {
- my ($content) = @_;
+ my ($content, $file_path, $current_line) = @_;
$_ = $$content;
# Constants
@@ -220,11 +233,16 @@ sub process_formatting {
s{FALSE}{FALSE
}g;
# Parameters
- s{@(\w+)}{$1}g;
+ warn "$file_path:$current_line: Old-style monodoc notation '\@param' used\n"
+ if s{@(\w+)}{$1}g && $WARNINGS;
+ s{\\p +(\w+)}{$1}g;
# Code
- s{#(\w+)}{$1
}g;
- s{\`([:.\w\*]+)\`}{$1
}g;
+ warn "$file_path:$current_line: Old-style monodoc notation '#code' used\n"
+ if s{#(\w+)}{$1
}g && $WARNINGS;
+ warn "$file_path:$current_line: Old-style monodoc notation '`code`' used\n"
+ if s{\`((?!api:)[:.\w\*]+)\`}{$1
}g && $WARNINGS;
+ s{\\c +(\S+(?$1}g;
$$content = $_;
}