[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[perl #24483][PATCH] =cut toggles POD/code compilation rather thanforcing code



Attached is a patch that adds a warning when a lone =cut is used

-- 
Renée Bäcker
renee.baecker@smart-websolutions.de

XING: http://www.xing.com/profile/Renee_Baecker
Foo-Magazin: http://foo-magazin.de

--- perldiag.pod.orig	2008-06-25 12:31:27.000000000 +0200
+++ perldiag.pod	2008-06-25 12:36:35.000000000 +0200
@@ -4563,6 +4563,11 @@
 (F) You called a Win32 function with incorrect arguments.
 See L<Win32> for more information.
 
+=item Used POD directive '=cut' without other POD directive
+
+(W misc) =cut indicates the end of POD, but you used this directive
+without any other directive in this POD paragraph.
+
 =item Useless (?-%s) - don't use /%s modifier in regex; marked by <-- HERE in m/%s/
 
 (W regexp) You have used an internal modifier such as (?-o) that has no
--- toke.orig	2008-06-25 12:31:56.000000000 +0200
+++ toke	2008-06-25 12:59:00.000000000 +0200
@@ -875,3 +875,9 @@
 Prototype after '%' for main::proto_after_hash : %$ at - line 7.
 Illegal character after '_' in prototype for main::underscore_fail : $_$ at - line 12.
 Prototype after '@' for main::underscore_after_at : @_ at - line 13.
+########
+# toke.c
+use warnings 'misc';
+=cut
+EXPECT
+Used POD directive '=cut' without other POD directive at - line 3.
--- toke.c.orig	2008-06-25 12:21:32.000000000 +0200
+++ toke.c	2008-06-25 12:24:42.000000000 +0200
@@ -4727,6 +4727,12 @@
 	    if (PL_expect == XSTATE && isALPHA(tmp) &&
 		(s == PL_linestart+1 || s[-2] == '\n') )
 		{
+
+                    if( strnEQ( s, "cut", 3 ) && ckWARN(WARN_MISC) ){
+                        Perl_warner(aTHX_ packWARN(WARN_MISC),
+                            "Used POD directive '=cut' without other POD directive" );
+                    }
+
 		    if (PL_in_eval && !PL_rsfp) {
 			d = PL_bufend;
 			while (s < d) {

Follow-Ups from:
Ronald J Kimball <rjk-perl-p5p@tamias.net>
Abigail <abigail@abigail.be>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]