Skip to content
Browse files

fix some types and initializers

also remove type constraints which previously have not been enforced
  • Loading branch information...
1 parent 677afae commit cb7ec7b67116f2eb8f2ac6965a718a1df491ffa1 @moritz moritz committed Mar 29, 2012
Showing with 6 additions and 6 deletions.
  1. +1 −1 lib/IETF/RFC_Grammar.pm
  2. +4 −4 lib/URI.pm
  3. +1 −1 lib/URI/Escape.pm
View
2 lib/IETF/RFC_Grammar.pm
@@ -24,7 +24,7 @@ method parse_validating($parse_str) {
or die "Parse failed";
}
-submethod BUILD($!rfc, $!grammar) {}
+submethod BUILD(:$!rfc, :$!grammar) {}
method new(Str $rfc, $grammar?) {
my $init_grammar = $grammar;
View
8 lib/URI.pm
@@ -6,9 +6,9 @@ use URI::Escape;
need URI::DefaultPort;
has $.grammar;
-has Bool $.is_validating is rw = False;
+has $.is_validating is rw = False;
has $!path;
-has Bool $!is_absolute;
+has $!is_absolute;
has $!scheme;
has $!authority;
has $!query;
@@ -111,15 +111,15 @@ method init ($str) {
}
# new can pass alternate grammars some day ...
-submethod BUILD($!is_validating?) {
+submethod BUILD(:$!is_validating) {
$!grammar = IETF::RFC_Grammar.new('rfc3896');
}
method new(Str $uri_pos1?, Str :$uri, :$is_validating) {
my $obj = self.bless(*);
if $is_validating.defined {
- $obj.is_validating = $is_validating;
+ $obj.is_validating = ?$is_validating;
}
if $uri.defined and $uri_pos1.defined {
View
2 lib/URI/Escape.pm
@@ -53,7 +53,7 @@ package URI::Escape {
$rc ~= $s.substr($last_pos, $/.from - $last_pos);
# should be a better way with list context
- my @encoded_octets = map { :16( .value ) }, $/.caps;
+ my @encoded_octets = map { :16( ~.value ) }, $/.caps;
# common case optimization
while @encoded_octets and ($no_utf8 or @encoded_octets[0] < 0x80) {
$rc ~= chr(shift @encoded_octets);

0 comments on commit cb7ec7b

Please sign in to comment.
Something went wrong with that request. Please try again.