chomp $input_line;
+ # Set a flag to indicate if we might be at an __END__ or __DATA__ line
+ # This will be used below to avoid quoting a bare word followed by
+ # a fat comma.
+ my $is_END_or_DATA;
+
# trim start of this line unless we are continuing a quoted line
# do not trim end because we might end in a quote (test: deken4.pl)
# Perl::Tidy::Formatter will delete needless trailing blanks
unless ( $in_quote && ( $quote_type eq 'Q' ) ) {
$input_line =~ s/^\s+//; # trim left end
+
+ $is_END_or_DATA = substr( $input_line, 0, 1 ) eq '_'
+ && $input_line =~ /^\s*__(END|DATA)__\s*$/;
}
- # Set a flag to indicate if we might be at an __END__ or __DATA__ line
- # This will be used below to avoid quoting a bare word followed by
- # a fat comma.
- my $is_END_or_DATA = $input_line =~ /^\s*__(END|DATA)__\s*$/;
# update the copy of the line for use in error messages
# This must be exactly what we give the pre_tokenizer
# and closing tokens.
###############################################################
- my ( $self, $rinput_hash ) = @_;
-
- my $leading_space_count = $rinput_hash->{leading_space_count};
- my $str = $rinput_hash->{line};
- my $str_length = $rinput_hash->{line_length};
- my $side_comment_length = $rinput_hash->{side_comment_length};
- my $outdent_long_lines = $rinput_hash->{outdent_long_lines};
- my $rvertical_tightness_flags = $rinput_hash->{rvertical_tightness_flags};
- my $level = $rinput_hash->{level};
+ my ( $self, $rinput ) = @_;
+
+ my $leading_space_count = $rinput->{leading_space_count};
+ my $str = $rinput->{line};
+ my $str_length = $rinput->{line_length};
+ my $side_comment_length = $rinput->{side_comment_length};
+ my $outdent_long_lines = $rinput->{outdent_long_lines};
+ my $rvertical_tightness_flags = $rinput->{rvertical_tightness_flags};
+ my $level = $rinput->{level};
my $last_level_written = $self->[_last_level_written_];