From b058816edd4fbb453d4ab45854b56d7126501b2b Mon Sep 17 00:00:00 2001 From: Jon Purdy Date: Tue, 28 Feb 2017 18:34:06 -0800 Subject: [exdoc] Update warnings. --- docs/exdoc | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'docs') diff --git a/docs/exdoc b/docs/exdoc index 597d62d70cd..63983db0d95 100644 --- a/docs/exdoc +++ b/docs/exdoc @@ -181,24 +181,29 @@ sub process_function { $_ = '

' if /^\s*$/; if ($section == $PARAMETER_SECTION) { - if (/\s*\\param +(\w+)\s+(.*)/) { + if (/\s*\\param +(\w+)(.*)/) { + # print "$file_path:$.: warning: Got parameter $1\n"; push @parameters, { name => $1, description => $2 }; - } elsif (/\s*\\deprecated +(.*)/) { + } elsif (/\s*\\deprecated(.*)/) { + # print "$file_path:$.: warning: Got deprecated annotation\n"; $deprecated = $1; } elsif (/\s*(\w+):(.*)/) { - warn "$file_path:$.: Old-style monodoc notation \@param used\n" - if $WARNINGS; 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 (s/(Returns?:|\\returns? )//) { + if (s/(Returns?:\s*|\\returns?\s*)//) { $returns = "\t$_\n"; $section = $RETURN_SECTION; } else { @@ -225,15 +230,15 @@ sub process_formatting { s{FALSE}{FALSE}g; # Parameters - warn "$file_path:$current_line: Old-style monodoc notation \@param used\n" + warn "$file_path:$current_line: Old-style monodoc notation '\@param' used\n" if s{@(\w+)}{$1}g && $WARNINGS; s{\\p +(\w+)}{$1}g; # Code - warn "$file_path:$current_line: Old-style monodoc notation #code used\n" + 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{\`([:.\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 +([\w\.]+)}{$1}g; $$content = $_; -- cgit v1.2.3