Permalink
Browse files

Add grammar rule for non-empty URI for searches and add hint hack for…

… module builders.
  • Loading branch information...
1 parent e87877e commit aea4e91be2fad5b044c950966e164caad386c11a @ronaldxs ronaldxs committed Jun 7, 2012
Showing with 18 additions and 1 deletion.
  1. +3 −0 lib/IETF/RFC_Grammar.pm
  2. +15 −1 lib/IETF/RFC_Grammar/URI.pm
View
3 lib/IETF/RFC_Grammar.pm
@@ -10,6 +10,9 @@ my %rfc_grammar_build = (
);
my %rfc_grammar;
+# Hack to give hint to ufo/Panda to build in the right order.
+# remove some day when module builders are upgraded
+use IETF::RFC_Grammar::URI;
has $.rfc;
has $.grammar;
View
16 lib/IETF/RFC_Grammar/URI.pm
@@ -7,25 +7,39 @@ use IETF::RFC_Grammar::IPv6;
grammar IETF::RFC_Grammar::URI is IETF::RFC_Grammar::IPv6 {
token TOP { <URI_reference> };
+ token TOP_non_empty { <URI> | <relative_ref_non_empty> };
token TOP_validating { ^ <URI_reference> $ };
token URI_reference { <URI> | <relative_ref> };
token absolute_URI { <scheme> ':' <.hier_part> [ '?' query ]? };
+
token relative_ref {
# need workaround for RT #112148/RT #107254
# <relative_part> [ '?' <query> ]? [ '#' <fragment> ]?
<relative_part> [
'?' <query> [ '#' <fragment> ]? | [ '#' <fragment> ]?
]
};
-
token relative_part {
'//' <authority> <path_abempty> |
<path_absolute> |
<path_noscheme> |
<path_empty>
};
+ token relative_ref_non_empty {
+# need workaround for RT #112148/RT #107254
+# <relative_part_non_empty> [ '?' <query> ]? [ '#' <fragment> ]?
+ <relative_part_non_empty> [
+ '?' <query> [ '#' <fragment> ]? | [ '#' <fragment> ]?
+ ]
+ };
+ token relative_part_non_empty {
+ '//' <authority> <path_abempty> |
+ <path_absolute> |
+ <path_noscheme>
+ };
+
token URI {
# need workaround for RT #112148/RT #107254
# <scheme> ':' <hier_part> ['?' <query> ]? [ '#' <fragment> ]?

0 comments on commit aea4e91

Please sign in to comment.