Permalink
Browse files

removed unnecessary /o flags from regexes

  • Loading branch information...
1 parent 18ac2cd commit b8780296d6247aef40d216ca8f51ae066a372acb @petdance petdance committed Apr 14, 2012
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2011, Parrot Foundation.
+# Copyright (C) 2001-2012, Parrot Foundation.
=head1 NAME
@@ -622,20 +622,20 @@ sub next_expr {
my $s = $_[0];
return "" unless $s;
# start of a subexpression?
- if ($s =~ /^\((.+)\)\s*(.*)/o) { # longest match to matching closing paren
+ if ($s =~ /^\((.+)\)\s*(.*)/) { # longest match to matching closing paren
$_[0] = $2 ? $2 : ""; # modify the 2nd arg
return $1;
}
else {
$s =~ s/^\s+//; # left-trim to make it more robust
- if ($s =~ m/^([-\w=]+)\s*(.*)?/o) { # shortest match to next non-word char
+ if ($s =~ /^([-\w=]+)\s*(.*)?/) { # shortest match to next non-word char
# start with word expr
$_[0] = $2 ? $2 : ""; # modify the 2nd arg expr in the caller
return $1;
}
else {
# special case: start with non-word op (perl-syntax only)
- $s =~ m/^([|&!])\s*(.*)?/o; # shortest match to next word char
+ $s =~ /^([|&!])\s*(.*)?/; # shortest match to next word char
$_[0] = $2 ? $2 : ""; # modify the 2nd arg expr in the caller
return $1;
}
@@ -73,7 +73,7 @@ Raises an exception if the distribution root is not found.
while ( $self = $self->SUPER::new($path) ) {
if ( $self->file_exists_with_name($file)
- and $self->file_with_name($file)->read =~ m/^This is Parrot/os )
+ and $self->file_with_name($file)->read =~ m/^This is Parrot/s )
{
$dist = $self;
last;
@@ -645,7 +645,7 @@ sub perl_script_file_with_name {
my $self = shift;
my $name = shift || return;
- $name .= '.pl' unless $name =~ /\.pl$/o;
+ $name .= '.pl' unless $name =~ /\.pl$/;
foreach my $dir ( $self->perl_script_file_directories ) {
return $dir->file_with_name($name)
@@ -692,7 +692,7 @@ sub perl_module_file_with_name {
my $self = shift;
my $name = shift || return;
- $name .= '.pm' unless $name =~ /\.pm$/o;
+ $name .= '.pm' unless $name =~ /\.pm$/;
foreach my $dir ( $self->perl_module_file_directories ) {
return $dir->file_with_name($name)
View
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2009, Parrot Foundation.
+# Copyright (C) 2004-2012, Parrot Foundation.
=head1 NAME
@@ -293,10 +293,10 @@ sub is_docs_link {
# download the file.
if ( $self->has_suffix ) {
- return 0 if $self->suffix !~ m/[Tt][Xx][Tt]/o;
+ return 0 if $self->suffix !~ m/txt/i;
}
else {
- return 1 if $self->name =~ m/^[[:upper:]]+$/o;
+ return 1 if $self->name =~ m/^[[:upper:]]+$/;
}
return $self->type =~ /Licence|info|docu|Text|TODO|status|MANIFEST|README/;
@@ -327,14 +327,14 @@ sub title {
$text = $1;
# Tidy it up a bit.
- $text =~ s/^\s+//o;
- $text =~ s/\s+$//o;
- $text =~ s/\s*-$//o;
+ $text =~ s/^\s+//;
+ $text =~ s/\s+$//;
+ $text =~ s/\s*-$//;
# There was not text, just another POD command (=head2 probably).
- return '' if $text =~ /^=\w/o;
+ return '' if $text =~ /^=\w/;
- return $text unless $text =~ /-/o;
+ return $text unless $text =~ /-/;
# There has to be some space each side of the dash.
my ( $path, $desc ) = split /\s+--?\s+/, $text, 2;
@@ -205,7 +205,7 @@ sub process_code_start_token {
my $text = $next->text;
- if ( $text =~ /^Parrot::/o ) {
+ if ( $text =~ /^Parrot::/ ) {
my $href = $self->href_for_perl_module($text);
@@ -247,7 +247,7 @@ sub process_file_start_token {
$dist->relative_path_is_file($text)
# A little bit of a hack to avoid config template files.
- and $text !~ /\.in$/o and $dist->file_with_relative_path($text)->contains_pod
+ and $text !~ /\.in$/ and $dist->file_with_relative_path($text)->contains_pod
)
{
my $path = $self->append_html_suffix($text);
@@ -505,7 +505,7 @@ sub resolve_pod_page_link {
my $to = shift;
my $section = shift;
- if ( $to =~ /^Parrot::/o ) {
+ if ( $to =~ /^Parrot::/ ) {
my $href = $self->href_for_perl_module($to);
# This gets corrupted somewhere down the line, with
View
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2006, Parrot Foundation.
+# Copyright (C) 2004-2012, Parrot Foundation.
=head1 NAME
@@ -189,7 +189,7 @@ Returns whether the file is "hidden", i.e. its name starts with a dot.
sub is_hidden {
my $self = shift;
- return $self->name =~ /^\./o;
+ return $self->name =~ /^\./;
}
=item C<is_generated()>
@@ -215,9 +215,9 @@ sub is_generated {
# lib/Parrot/Config.pm
return 1
- if $self->suffix =~ /^(?:dump|html|flag|o)$/o
+ if $self->suffix =~ /^(?:dump|html|flag|o)$/
or $self->name =~
-/^(?:perl6-config|libparrot.def|CFLAGS|myconfig|(?:core_pmcs|exec_(?:cpu|dep)|fingerprint|jit_(?:cpu|emit)|nci|platform(?:_interface)?)\.[ch]|(?:charclass|feature)\.h)$/o
+/^(?:perl6-config|libparrot.def|CFLAGS|myconfig|(?:core_pmcs|exec_(?:cpu|dep)|fingerprint|jit_(?:cpu|emit)|nci|platform(?:_interface)?)\.[ch]|(?:charclass|feature)\.h)$/
or $self->parent->name eq 'ops' and $self->suffix =~ /^(?:c|pod)$/;
return 0;
View
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2006, Parrot Foundation.
+# Copyright (C) 2004-2012, Parrot Foundation.
=head1 NAME
@@ -140,7 +140,7 @@ sub name_without_suffix {
my $self = shift;
my $name = $self->name;
- $name =~ s/\.[^\.]*$//o;
+ $name =~ s/\.[^\.]*$//;
return $name;
}
View
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2011, Parrot Foundation.
+# Copyright (C) 2007-2012, Parrot Foundation.
=head1 NAME
@@ -263,9 +263,9 @@ sub _get_current_files {
while ( my $line = <$FILE> ) {
chomp $line;
- next if $line =~ /^\s*$/o;
+ next if $line =~ /^\s*$/;
- next if $line =~ /^#/o;
+ next if $line =~ /^#/;
my ($file) = split /\s+/, $line;
$current_files{ $file }++;
@@ -425,8 +425,8 @@ sub _get_current_skips {
or die "Unable to open $self->{skip} for reading";
while ( my $line = <$SKIP> ) {
chomp $line;
- next if $line =~ /^\s*$/o;
- next if $line =~ /^#/o;
+ next if $line =~ /^\s*$/;
+ next if $line =~ /^#/;
$current_skips{$line}++;
}
close $SKIP or die "Unable to close $self->{skip} after reading";
@@ -441,8 +441,8 @@ sub _get_proposed_skips {
my @proposed_lines = split /\n/, $print_str;
my %proposed_skips = ();
for my $line (@proposed_lines) {
- next if $line =~ /^\s*$/o;
- next if $line =~ /^#/o;
+ next if $line =~ /^\s*$/;
+ next if $line =~ /^#/;
$proposed_skips{$line}++;
}

0 comments on commit b878029

Please sign in to comment.