develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34131 - trunk/lib/Parrot/Pmc2c

From:
petdance
Date:
December 20, 2008 00:04
Subject:
[svn:parrot] r34131 - trunk/lib/Parrot/Pmc2c
Message ID:
20081220080447.73C12CBA12@x12.develooper.com
Author: petdance
Date: Sat Dec 20 00:04:46 2008
New Revision: 34131

Modified:
   trunk/lib/Parrot/Pmc2c/Parser.pm

Log:
no recompiling regexes in while loops

Modified: trunk/lib/Parrot/Pmc2c/Parser.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/Parser.pm	(original)
+++ trunk/lib/Parrot/Pmc2c/Parser.pm	Sat Dec 20 00:04:46 2008
@@ -130,7 +130,7 @@
     (/\*.*?\*/)?
     }sx;
 
-    while ($pmcbody =~ s/($attr_re)//) {
+    while ($pmcbody =~ s/($attr_re)//o) {
         my ($type, $name, @modifiers, $comment);
         $type = $2;
         $name = $3;
@@ -186,7 +186,7 @@
         \s*
     }sx;
 
-    while ( $pmcbody =~ s/($signature_re)// ) {
+    while ( $pmcbody =~ s/($signature_re)//o ) {
         my ( $decorators, $marker, $methodname, $parameters, $rawattrs ) =
             ( $2, $3, $4, $5, $6 );
         my $attrs = defined $rawattrs ? parse_method_attrs($rawattrs) : {};
@@ -520,8 +520,8 @@
     my $code       = shift;
     my $unbalanced = 0;
 
-    die "Unexpected whitespace, expecting" if $code =~ /^\s+/;
-    die "bad block open: ", substr( $code, 0, 40 ), "..." unless $code =~ /^\{/;
+    die 'Unexpected whitespace, expecting' if $code =~ /^\s+/;
+    die 'bad block open: ', substr( $code, 0, 40 ), '...' unless $code =~ /^\{/;
 
     # create a copy and remove strings and comments so that
     # unbalanced {} can be used in them in PMCs, being careful to



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