From 1bd1dff6d449ab221e191679fd8ec516b7cc1d4e Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Mon, 8 Apr 2019 19:30:35 +0200 Subject: Initial commit --- lib/URL/Grammar.pm6 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 lib/URL/Grammar.pm6 (limited to 'lib/URL/Grammar.pm6') diff --git a/lib/URL/Grammar.pm6 b/lib/URL/Grammar.pm6 new file mode 100644 index 0000000..cc9f13c --- /dev/null +++ b/lib/URL/Grammar.pm6 @@ -0,0 +1,48 @@ +#! /usr/bin/env false + +use v6.d; + +unit grammar URL::Grammar; + +token TOP { + [ ":" ]? + "//"? + [ "@" ]? + ? + ? + [ "?" ]? + [ "#" ]? +} + +token scheme { <[ a..z ]> <[ a..z 0..9 . + - ]>* } +token userinfo { [ ":" ] } +token username { <-[ : @ ]>+ } +token password { <-[ @ ]>+ } +token host { [ ":" ]? } +token hostname { [ <-[ / : # ? \h ]>+ | "[" <-[ \] ]>+ "]" ] } +token port { \d ** 1..5 } +token path { "/" * % "/" } +token path-part { <-[ / ? # ]>+ } +token query { * % "&" } +token query-part { "=" } +token query-part-key { <-[ = # & ]>+ } +token query-part-value { <-[ # & ]>+ } +token fragment { <-[ \s ]>+ } + +=begin pod + +=NAME URL::Grammar +=AUTHOR Patrick Spek +=VERSION 0.1.0 + +=head1 Synopsis + +=head1 Description + +=head1 Examples + +=head1 See also + +=end pod + +# vim: ft=perl6 noet -- cgit v1.1