# allow the user to change it
if ( $rOpts->{'static-block-comment-prefix'} ) {
my $prefix = $rOpts->{'static-block-comment-prefix'};
- $prefix =~ s/^\s*//;
+ $prefix =~ s/^\s+//;
my $pattern = $prefix;
# user may give leading caret to force matching left comments only
my ( $opt_name, $default ) = @_;
my $param = $rOpts->{$opt_name};
if ( !$param ) { $param = $default }
- $param =~ s/^\s*//;
+ $param =~ s/^\s+//;
if ( $param !~ /^#/ ) {
Die("ERROR: the $opt_name parameter '$param' must begin with '#'\n");
}
# allow the user to change it
if ( $rOpts->{'non-indenting-brace-prefix'} ) {
my $prefix = $rOpts->{'non-indenting-brace-prefix'};
- $prefix =~ s/^\s*//;
+ $prefix =~ s/^\s+//;
if ( $prefix !~ /^#/ ) {
Die("ERROR: the -nibp parameter '$prefix' must begin with '#'\n");
}
# allow the user to change it
if ( $rOpts->{'static-side-comment-prefix'} ) {
my $prefix = $rOpts->{'static-side-comment-prefix'};
- $prefix =~ s/^\s*//;
+ $prefix =~ s/^\s+//;
my $pattern = '^' . $prefix;
if ( bad_pattern($pattern) ) {
Die(
$token = balance_csc_text($token)
if $rOpts->{'closing-side-comments-balanced'};
- $token =~ s/\s*$//; # trim any trailing whitespace
+ $token =~ s/\s+$//; # trim any trailing whitespace
# handle case of existing closing side comment
if ($have_side_comment) {
#
# Perl::Tidy::Tokenizer reads a source and breaks it into a stream of tokens
#
-# Usage:
+# Usage Outline:
#
# STEP 1: initialize or re-initialze Tokenizer with user options
# Perl::Tidy::Tokenizer::check_options($rOpts);
my ( $rOpts, $opt_name, $default ) = @_;
my $param = $rOpts->{$opt_name};
if ( !$param ) { $param = $default }
- $param =~ s/^\s*//; # allow leading spaces to be like format-skipping
+ $param =~ s/^\s+//; # allow leading spaces to be like format-skipping
if ( $param !~ /^#/ ) {
Die("ERROR: the $opt_name parameter '$param' must begin with '#'\n");
}
# Handle <<~ targets, which are indicated here by a leading space on
# the here quote character
if ( $here_quote_character =~ /^\s/ ) {
- $candidate_target =~ s/^\s*//;
+ $candidate_target =~ s/^\s+//;
}
if ( $candidate_target eq $here_doc_target ) {
$self->[_nearly_matched_here_target_at_] = undef;
my ( $rpre_tokens, $rmap, $rpre_types );
while ( $line = $self->peek_ahead( $i++ ) ) {
- $line =~ s/^\s*//; # trim leading blanks
+ $line =~ s/^\s+//; # trim leading blanks
next if ( length($line) <= 0 ); # skip blank
next if ( $line =~ /^#/ ); # skip comment
( $rpre_tokens, $rmap, $rpre_types ) =
my $i = 0;
while ( $line = $self->peek_ahead( $i++ ) ) {
- $line =~ s/^\s*//; # trim leading blanks
+ $line =~ s/^\s+//; # trim leading blanks
next if ( length($line) <= 0 ); # skip blank
next if ( $line =~ /^#/ ); # skip comment
make_numbered_line( $line_number, $input_line, $pos );
$underline = write_on_underline( $underline, $pos - $offset, $carrat );
$self->warning( $numbered_line . "\n" );
- $underline =~ s/\s*$//;
+ $underline =~ s/\s+$//;
$self->warning( $underline . "\n" );
return;
} ## end sub write_error_indicator_pair