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

Reply via email to