develooper Front page | perl.perl5.porters | Postings from August 2013

[perl #117087] forbid empty parts in package names

Thread Previous | Thread Next
From:
Tony Cook via RT
Date:
August 5, 2013 02:03
Subject:
[perl #117087] forbid empty parts in package names
Message ID:
rt-3.6.HEAD-2552-1375668170-1054.117087-15-0@perl.org
On Sun Aug 04 18:59:28 2013, tonyc wrote:
> On Wed Jul 31 22:29:40 2013, tonyc wrote:
> > I've attached the rebased patches, but the final patch is obviously
> > incomplete.
> 
> Brian updated his branch on github, I've attached the new patch series.
> 
> Tony

The only questionable part to me (besides some whitespace issues), is
this modification to S_scan_word():

@@ -9360,6 +9396,8 @@ S_scan_word(pTHX_ char *s, char *dest, STRLEN
destlen, int allow_package, STRLEN
     parse_ident(&s, &d, e, allow_package, is_utf8);
     *d = '\0';
     *slp = d - dest;
+    if ( allow_package && *slp && *slp >= 4 )
+            deprecate_empty_packages(dest);
     return s;
 }
 
I know parsers (and especially perl's parser) tend to be messy, but I'm
not sure that check belongs in scan_word - changing it from "scan a
word" to "scan a word and optionally warn".

Unless someone else speaks up I plan to apply it as is (with whitespace
fixes.)

Tony


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=117087

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About