From ba793ec6d1d4c66300f40cbced25f9ffd23ec792 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 6 Dec 2015 15:05:29 -0500 Subject: Debug --- lib/IRC/Grammar/Actions.pm6 | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'lib/IRC/Grammar') diff --git a/lib/IRC/Grammar/Actions.pm6 b/lib/IRC/Grammar/Actions.pm6 index 039f11e..7093b99 100644 --- a/lib/IRC/Grammar/Actions.pm6 +++ b/lib/IRC/Grammar/Actions.pm6 @@ -1,6 +1,26 @@ -class IRC::Grammar::Actions { - method class ($/) { $/.make: ~$/ } - method rules ($/) { $/.make: ~$/ } - method pair ($/) { $/.make: $.made => $.made } - method TOP ($/) { $/.make: $».made } +unit class IRC::Grammar::Actions:ver<1.001001>; +method TOP ($/) { $/.make: $>>.made } +method message ($/) { + my $pref = $/; + my %args = command => ~$/; + if ( $pref.defined ) { + %args = ~$pref; + } + else { + %args = $pref».Str; + } + + my $p = $/; + loop { + if ( $p.defined ) { + %args.append: ~$p; + } + if ( $p.defined ) { + %args.append: ~$p; + last; + } + $p = $p; + } + + $/.make: %args; } -- cgit v1.1