Skip to content

Commit

Permalink
Merge pull request #1231 from MasterDuke17/more_normalizing_proto_bodies
Browse files Browse the repository at this point in the history
Convert the rest of the `{ * }` to `{*}`
  • Loading branch information
zoffixznet committed Nov 4, 2017
2 parents 8b24bf5 + 102fbd5 commit 33d476d
Show file tree
Hide file tree
Showing 47 changed files with 143 additions and 143 deletions.
2 changes: 1 addition & 1 deletion src/core.d/await.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ my role X::Await::Died {
}
}

proto sub await(|) { * }
proto sub await(|) {*}
multi sub await() {
die "Must specify an Awaitable to await (got an empty list)";
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/Array.pm
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ my class Array { # declared in BOOTSTRAP
)
}

proto method new(|) { * }
proto method new(|) {*}
multi method new(:$shape!) {
nqp::if(
nqp::defined($shape),
Expand Down Expand Up @@ -223,7 +223,7 @@ my class Array { # declared in BOOTSTRAP
nqp::create(self).STORE(@values)
}

proto method STORE(|) { * }
proto method STORE(|) {*}
multi method STORE(Array:D: Iterable:D \iterable) {
nqp::iscont(iterable)
?? self!STORE-ONE(iterable)
Expand Down
16 changes: 8 additions & 8 deletions src/core/Baggy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ my role Baggy does QuantHash {
}
}.new($!elems))
}
proto method kxxv(|) { * }
proto method kxxv(|) {*}
multi method kxxv(Baggy:D:) {
Seq.new(class :: does Rakudo::Iterator::Mappy {
has Mu $!key;
Expand Down Expand Up @@ -355,7 +355,7 @@ my role Baggy does QuantHash {
}

#--- selection methods
proto method grabpairs (|) { * }
proto method grabpairs (|) {*}
multi method grabpairs(Baggy:D:) {
nqp::if(
$!elems && nqp::elems($!elems),
Expand Down Expand Up @@ -393,7 +393,7 @@ my role Baggy does QuantHash {
}.new($!elems, $count))
}

proto method pickpairs(|) { * }
proto method pickpairs(|) {*}
multi method pickpairs(Baggy:D:) {
nqp::if(
$!elems && nqp::elems($!elems),
Expand All @@ -419,12 +419,12 @@ my role Baggy does QuantHash {
}.new($!elems, $count))
}

proto method grab(|) { * }
proto method grab(|) {*}
multi method grab(Baggy:D: |c) {
X::Immutable.new( method => 'grab', typename => self.^name ).throw;
}

proto method pick(|) { * }
proto method pick(|) {*}
multi method pick(Baggy:D:) { self.roll }
multi method pick(Baggy:D: Callable:D $calculate) {
self.pick( $calculate(self.total) )
Expand Down Expand Up @@ -538,7 +538,7 @@ my role Baggy does QuantHash {
))
}

proto method roll(|) { * }
proto method roll(|) {*}
multi method roll(Baggy:D:) {
nqp::if(
$!elems && (my $total := self.total),
Expand Down Expand Up @@ -597,7 +597,7 @@ my role Baggy does QuantHash {
}

#--- classification method
proto method classify-list(|) { * }
proto method classify-list(|) {*}
multi method classify-list( &test, \list) {
fail X::Cannot::Lazy.new(:action<classify>) if list.is-lazy;
my \iter = (nqp::istype(list, Iterable) ?? list !! list.list).iterator;
Expand Down Expand Up @@ -629,7 +629,7 @@ my role Baggy does QuantHash {
self.classify-list(&test, @list, |c);
}

proto method categorize-list(|) { * }
proto method categorize-list(|) {*}
multi method categorize-list( &test, \list ) {
fail X::Cannot::Lazy.new(:action<categorize>) if list.is-lazy;
my \iter = (nqp::istype(list, Iterable) ?? list !! list.list).iterator;
Expand Down
46 changes: 23 additions & 23 deletions src/core/Bool.pm
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# enum Bool declared in BOOTSTRAP
BEGIN {
Bool.^add_method('Bool', my proto method Bool(|) { * });
Bool.^add_method('gist', my proto method gist(|) { * });
Bool.^add_method('Numeric', my proto method Numeric(|) { * });
Bool.^add_method('Int', my proto method Int(|) { * });
Bool.^add_method('ACCEPTS', my proto method ACCEPTS(|) { * });
Bool.^add_method('pick', my proto method pick(|) { * });
Bool.^add_method('roll', my proto method roll(|) { * });
Bool.^add_method('perl', my proto method perl(|) { * });
Bool.^add_method('Bool', my proto method Bool(|) {*});
Bool.^add_method('gist', my proto method gist(|) {*});
Bool.^add_method('Numeric', my proto method Numeric(|) {*});
Bool.^add_method('Int', my proto method Int(|) {*});
Bool.^add_method('ACCEPTS', my proto method ACCEPTS(|) {*});
Bool.^add_method('pick', my proto method pick(|) {*});
Bool.^add_method('roll', my proto method roll(|) {*});
Bool.^add_method('perl', my proto method perl(|) {*});
}
BEGIN {
Bool.^add_multi_method('Bool', my multi method Bool(Bool:D:) { self });
Expand Down Expand Up @@ -63,52 +63,52 @@ multi sub postfix:<-->(Bool:D $a is rw) {
}
}

proto sub prefix:<?>(Mu $) is pure { * }
proto sub prefix:<?>(Mu $) is pure {*}
multi sub prefix:<?>(Bool:D \a) { a }
multi sub prefix:<?>(Bool:U \a) { Bool::False }
multi sub prefix:<?>(Mu \a) { a.Bool }

proto sub prefix:<so>(Mu $) is pure { * }
proto sub prefix:<so>(Mu $) is pure {*}
multi sub prefix:<so>(Bool:D \a) { a }
multi sub prefix:<so>(Bool:U \a) { Bool::False }
multi sub prefix:<so>(Mu \a) { a.Bool }

proto sub prefix:<!>(Mu $) is pure { * }
proto sub prefix:<!>(Mu $) is pure {*}
multi sub prefix:<!>(Bool \a) { nqp::p6bool(nqp::not_i(nqp::istrue(a))) }
multi sub prefix:<!>(Mu \a) { nqp::p6bool(nqp::not_i(nqp::istrue(a))) }

proto sub prefix:<not>(Mu $) is pure { * }
proto sub prefix:<not>(Mu $) is pure {*}
multi sub prefix:<not>(Bool \a) { nqp::p6bool(nqp::not_i(nqp::istrue(a))) }
multi sub prefix:<not>(Mu \a) { nqp::p6bool(nqp::not_i(nqp::istrue(a))) }

proto sub prefix:<?^>(Mu $) is pure { * }
proto sub prefix:<?^>(Mu $) is pure {*}
multi sub prefix:<?^>(Mu \a) { not a }

proto sub infix:<?&>(Mu $?, Mu $?) is pure { * }
proto sub infix:<?&>(Mu $?, Mu $?) is pure {*}
multi sub infix:<?&>(Mu $x = Bool::True) { $x.Bool }
multi sub infix:<?&>(Mu \a, Mu \b) { a.Bool && b.Bool }

proto sub infix:<?|>(Mu $?, Mu $?) is pure { * }
proto sub infix:<?|>(Mu $?, Mu $?) is pure {*}
multi sub infix:<?|>(Mu $x = Bool::False) { $x.Bool }
multi sub infix:<?|>(Mu \a, Mu \b) { a.Bool || b.Bool }

proto sub infix:<?^>(Mu $?, Mu $?) is pure { * }
proto sub infix:<?^>(Mu $?, Mu $?) is pure {*}
multi sub infix:<?^>(Mu $x = Bool::False) { $x.Bool }
multi sub infix:<?^>(Mu \a, Mu \b) { nqp::p6bool(nqp::ifnull(nqp::xor(a.Bool,b.Bool), 0)) }

# These operators are normally handled as macros in the compiler;
# we define them here for use as arguments to functions.
proto sub infix:<&&>(|) { * }
proto sub infix:<&&>(|) {*}
multi sub infix:<&&>(Mu $x = Bool::True) { $x }
multi sub infix:<&&>(Mu \a, &b) { a && b() }
multi sub infix:<&&>(Mu \a, Mu \b) { a && b }

proto sub infix:<||>(|) { * }
proto sub infix:<||>(|) {*}
multi sub infix:<||>(Mu $x = Bool::False) { $x }
multi sub infix:<||>(Mu \a, &b) { a || b() }
multi sub infix:<||>(Mu \a, Mu \b) { a || b }

proto sub infix:<^^>(|) { * }
proto sub infix:<^^>(|) {*}
multi sub infix:<^^>(Mu $x = Bool::False) { $x }
multi sub infix:<^^>(Mu \a, &b) { a ^^ b() }
multi sub infix:<^^>(Mu \a, Mu \b) { a ^^ b }
Expand All @@ -124,22 +124,22 @@ multi sub infix:<^^>(+@a) {
$a;
}

proto sub infix:<//>(|) { * }
proto sub infix:<//>(|) {*}
multi sub infix:<//>(Mu $x = Any) { $x }
multi sub infix:<//>(Mu \a, &b) { a // b }
multi sub infix:<//>(Mu \a, Mu \b) { a // b }

proto sub infix:<and>(|) { * }
proto sub infix:<and>(|) {*}
multi sub infix:<and>(Mu $x = Bool::True) { $x }
multi sub infix:<and>(Mu \a, &b) { a && b }
multi sub infix:<and>(Mu \a, Mu \b) { a && b }

proto sub infix:<or>(|) { * }
proto sub infix:<or>(|) {*}
multi sub infix:<or>(Mu $x = Bool::False) { $x }
multi sub infix:<or>(Mu \a, &b) { a || b }
multi sub infix:<or>(Mu \a, Mu \b) { a || b }

proto sub infix:<xor>(|) { * }
proto sub infix:<xor>(|) {*}
multi sub infix:<xor>(Mu $x = Bool::False) { $x }
multi sub infix:<xor>(Mu \a, &b) { a ^^ b }
multi sub infix:<xor>(Mu \a, Mu \b) { a ^^ b }
Expand Down
8 changes: 4 additions & 4 deletions src/core/Buf.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is
}
multi method new(Blob: *@values) { self.new(@values) }

proto method allocate(|) { * }
proto method allocate(|) {*}
multi method allocate(Blob:U: Int $elements) {
nqp::setelems(nqp::create(self),$elements)
}
Expand Down Expand Up @@ -115,7 +115,7 @@ my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is
multi method Str(Blob:D:) { X::Buf::AsStr.new(method => 'Str' ).throw }
multi method Stringy(Blob:D:) { X::Buf::AsStr.new(method => 'Stringy' ).throw }

proto method decode(|) { * }
proto method decode(|) {*}
multi method decode(Blob:D:) {
nqp::p6box_s(nqp::decode(self, 'utf8'))
}
Expand Down Expand Up @@ -248,7 +248,7 @@ my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is
nqp::join($delim.Str,$list)
}

proto method unpack(|) { * }
proto method unpack(|) {*}
multi method unpack(Blob:D: Str:D $template) {
nqp::isnull(nqp::getlexcaller('EXPERIMENTAL-PACK')) and X::Experimental.new(
feature => "the 'unpack' method",
Expand Down Expand Up @@ -618,7 +618,7 @@ constant buf16 = Buf[uint16];
constant buf32 = Buf[uint32];
constant buf64 = Buf[uint64];

proto sub pack(|) { * }
proto sub pack(|) {*}
multi sub pack(Str $template, *@items) {
nqp::isnull(nqp::getlexcaller('EXPERIMENTAL-PACK')) and X::Experimental.new(
feature => "the 'pack' function",
Expand Down
2 changes: 1 addition & 1 deletion src/core/Code.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ my class Code does Callable { # declared in BOOTSTRAP

method signature(Code:D:) { $!signature }

proto method prec(|) { * }
proto method prec(|) {*}
multi method prec() { my % }
multi method prec(Str:D $) { '' }

Expand Down
2 changes: 1 addition & 1 deletion src/core/CompUnit/Loader.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CompUnit::Loader is repr('Uninstantiable') {
}

# Load a pre-compiled file
proto method load-precompilation-file(|) { * }
proto method load-precompilation-file(|) {*}
multi method load-precompilation-file(IO::Path $path --> CompUnit::Handle:D) {
my $handle := CompUnit::Handle.new;
my $*CTXSAVE := $handle;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Deprecations.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Deprecation {
($!file||"",$!type||"",$!package||"",$!name).join(':');
}

proto method report (|) { * }
proto method report (|) {*}
multi method report (Deprecation:U:) {
return Nil unless %DEPRECATIONS;

Expand Down
2 changes: 1 addition & 1 deletion src/core/Distribution.pm
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class Distribution::Resources does Associative {
has Str $.repo;
has Str $.repo-name;

proto method BUILD(|) { * }
proto method BUILD(|) {*}

multi method BUILD(:$!dist-id, CompUnit::Repository :$repo --> Nil) {
unless $repo.can('name') and $!repo-name = $repo.name and $!repo-name ne '' {
Expand Down
4 changes: 2 additions & 2 deletions src/core/Hash.pm
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ my class Hash { # declared in BOOTSTRAP
self
}

proto method classify-list(|) { * }
proto method classify-list(|) {*}
multi method classify-list( &test, \list, :&as ) {
fail X::Cannot::Lazy.new(:action<classify>) if list.is-lazy;
my \iter = (nqp::istype(list, Iterable) ?? list !! list.list).iterator;
Expand Down Expand Up @@ -371,7 +371,7 @@ my class Hash { # declared in BOOTSTRAP
self.classify-list(&test, @list, |c);
}

proto method categorize-list(|) { * }
proto method categorize-list(|) {*}
multi method categorize-list( &test, \list, :&as ) {
fail X::Cannot::Lazy.new(:action<categorize>) if list.is-lazy;
my \iter = (nqp::istype(list, Iterable) ?? list !! list.list).iterator;
Expand Down
20 changes: 10 additions & 10 deletions src/core/IO/CatHandle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ my class IO::CatHandle is IO::Handle {
($!active-handle = Nil))
}

proto method encoding(|) { * }
proto method encoding(|) {*}
multi method encoding(::?CLASS:D:) { $!encoding || Nil }
multi method encoding(::?CLASS:D: $enc is copy) {
$!encoding = nqp::if(
Expand Down Expand Up @@ -352,26 +352,26 @@ my class IO::CatHandle is IO::Handle {
# | /
# |/
# (⛣)
proto method flush (|) { * }
proto method flush (|) {*}
multi method flush (|) { die X::NYI.new: :feature<flush> }
proto method out-buffer (|) { * }
proto method out-buffer (|) {*}
multi method out-buffer (|) { die X::NYI.new: :feature<out-buffer> }
proto method print (|) { * }
proto method print (|) {*}
multi method print (|) { die X::NYI.new: :feature<print> }
proto method printf (|) { * }
proto method printf (|) {*}
multi method printf (|) { die X::NYI.new: :feature<printf> }
proto method print-nl (|) { * }
proto method print-nl (|) {*}
multi method print-nl (|) { die X::NYI.new: :feature<print-nl> }
proto method put (|) { * }
proto method put (|) {*}
multi method put (|) { die X::NYI.new: :feature<put> }
proto method say (|) { * }
proto method say (|) {*}
multi method say (|) { die X::NYI.new: :feature<say> }
proto method write (|) { * }
proto method write (|) {*}
multi method write (|) { die X::NYI.new: :feature<write> }
# /|\

# Don't die on this one, as doing so breaks .Capture
# proto method nl-out (|) { * }
# proto method nl-out (|) {*}
# multi method nl-out (|) {
# die X::NYI.new: :feature<nl-out>
# }
Expand Down
Loading

0 comments on commit 33d476d

Please sign in to comment.