aboutsummaryrefslogtreecommitdiff
path: root/lib/IRC/Grammar/Actions.pm6
diff options
context:
space:
mode:
authorZoffix Znet <cpan@zoffix.com>2015-12-06 18:07:19 -0500
committerZoffix Znet <cpan@zoffix.com>2015-12-06 18:07:19 -0500
commitd2da9fcd250533bee5df17bd182648a8cea0d7b0 (patch)
treefca0431ce3639d5a2ac85a69c4fe9f05717be789 /lib/IRC/Grammar/Actions.pm6
parentba793ec6d1d4c66300f40cbced25f9ffd23ec792 (diff)
Prerelease
Diffstat (limited to 'lib/IRC/Grammar/Actions.pm6')
-rw-r--r--lib/IRC/Grammar/Actions.pm69
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/IRC/Grammar/Actions.pm6 b/lib/IRC/Grammar/Actions.pm6
index 7093b99..74a8f11 100644
--- a/lib/IRC/Grammar/Actions.pm6
+++ b/lib/IRC/Grammar/Actions.pm6
@@ -3,12 +3,11 @@ method TOP ($/) { $/.make: $<message>>>.made }
method message ($/) {
my $pref = $/<prefix>;
my %args = command => ~$/<command>;
- if ( $pref<servername>.defined ) {
- %args<who><host> = ~$pref<servername>;
- }
- else {
- %args<who><nick user host> = $pref<nick user host>ยป.Str;
+ for qw/nick user host/ {
+ $pref{$_}.defined or next;
+ %args<who>{$_} = $pref{$_}.Str;
}
+ %args<who><host> = ~$pref<servername> if $pref<servername>.defined;
my $p = $/<params>;
loop {