mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-24 03:33:06 +01:00
Factoids: minor style clean-up
This commit is contained in:
parent
287d102aed
commit
9b0696b898
@ -545,7 +545,6 @@ sub make_list {
|
||||
$item =~ s/^\s+|\s+$//g;
|
||||
$item =~ s/\\\|/|/g;
|
||||
|
||||
|
||||
if ($settings->{'uc'}) { $item = uc $item; }
|
||||
|
||||
if ($settings->{'lc'}) { $item = lc $item; }
|
||||
@ -582,7 +581,6 @@ sub make_list {
|
||||
sub select_item {
|
||||
my ($self, $context, $extracted, $modifier, %opts) = @_;
|
||||
|
||||
|
||||
my %settings = $self->parse_expansion_modifiers($modifier);
|
||||
|
||||
my $item;
|
||||
@ -742,11 +740,9 @@ sub expand_factoid_vars {
|
||||
my $matches = 0;
|
||||
my $expansions = 0;
|
||||
|
||||
|
||||
while ($rest =~ s/(.*?)(?<!\\)\$([\w|{])/$2/ms) {
|
||||
$result .= $1;
|
||||
|
||||
|
||||
my $var;
|
||||
my $extract_method;
|
||||
|
||||
@ -812,14 +808,11 @@ sub expand_factoid_vars {
|
||||
|
||||
if (wantarray) {
|
||||
@replacements = $self->select_item($context, join ('|', @list), \$rest, %opts);
|
||||
return @replacements;
|
||||
} else {
|
||||
push @replacements, scalar $self->select_item($context, join ('|', @list), \$rest, %opts);
|
||||
}
|
||||
|
||||
if (wantarray) {
|
||||
return @replacements;
|
||||
}
|
||||
|
||||
my $replacement = $opts{nested} ? join('|', @replacements) : "@replacements";
|
||||
|
||||
if (not length $replacement) {
|
||||
@ -849,9 +842,7 @@ sub expand_factoid_vars {
|
||||
}
|
||||
}
|
||||
|
||||
if ($matches == 0 or $expansions == 0) {
|
||||
last;
|
||||
}
|
||||
last if $matches == 0 or $expansions == 0;
|
||||
|
||||
if (not length $rest) {
|
||||
$rest = $result;
|
||||
|
Loading…
Reference in New Issue
Block a user