aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/IRC/Grammar.pm62
-rw-r--r--t/network-freenode.t18
-rw-r--r--t/rfc1459.t0
3 files changed, 19 insertions, 1 deletions
diff --git a/lib/IRC/Grammar.pm6 b/lib/IRC/Grammar.pm6
index f859edc..0bc86f7 100644
--- a/lib/IRC/Grammar.pm6
+++ b/lib/IRC/Grammar.pm6
@@ -28,7 +28,7 @@ token host { <hostname> | <hostaddr> }
token hostname { <shortname> [ '.' <shortname> ]* '.'? }
token hostaddr { <ip6addr> | <ip4addr> }
token ip4addr { [ \d ** 1..3 ] ** 4 % '.' }
-token ip6addr { [ <[ \d a..f A..F ]> ** 1..4 ] ** 8 % ':' }
+token ip6addr { [ <[ \d a..f A..F ]> ** 1..4 ] ** 1..8 % [ '::' | ':' ] }
token shortname { <[ \w \d / ]> <[ \w \d / \- ]>* <[ \w \d / ]>? }
token nospcrlfcl { <-[ \0 \r \n \s : ]> }
diff --git a/t/network-freenode.t b/t/network-freenode.t
new file mode 100644
index 0000000..b9e32a5
--- /dev/null
+++ b/t/network-freenode.t
@@ -0,0 +1,18 @@
+#!/usr/bin/env raku
+
+use Test;
+
+use IRC::Grammar;
+
+plan 1;
+
+subtest ':Geth!~raku@2a01:4f9:c010:e20c::1 JOIN #raku-dev', {
+ plan 4;
+
+ my $match = IRC::Grammar.parse(':Geth!~raku@2a01:4f9:c010:e20c::1 JOIN #raku-dev');
+
+ ok $match;
+ is $match<prefix>, 'Geth!~raku@2a01:4f9:c010:e20c::1';
+ is $match<command>, 'JOIN';
+ is $match<params>[0], '#raku-dev';
+}
diff --git a/t/rfc1459.t b/t/rfc1459.t
deleted file mode 100644
index e69de29..0000000
--- a/t/rfc1459.t
+++ /dev/null