Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'nom' into newio
  • Loading branch information
lizmat committed Feb 7, 2015
2 parents 3d80ceb + db6254b commit 727f247
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/core/Exception.pm
Expand Up @@ -934,10 +934,6 @@ my class X::Syntax::Argument::MOPMacro does X::Syntax {
method message() { "Cannot give arguments to $.macro" };
}

my class X::Does::TypeObject is Exception {
method message() { "Cannot use 'does' operator with a type object." }
}

my class X::Role::Initialization is Exception {
has $.role;
method message() { "Can only supply an initialization value for a role if it has a single public attribute, but this is not the case for '{$.role.^name}'" }
Expand Down
3 changes: 3 additions & 0 deletions src/core/IO/Symlink.pm
@@ -0,0 +1,3 @@
# placeholder file to facilitate switching between nom and newio branches

# vim: ft=perl6 expandtab sw=4
9 changes: 7 additions & 2 deletions src/core/operators.pm
Expand Up @@ -7,6 +7,11 @@ sub infix:<=>(Mu \a, Mu \b) is rw {
nqp::p6store(a, b)
}

my class X::Does::TypeObject is Exception {
has Mu $.type;
method message() { "Cannot use 'does' operator with a type object." }
}

proto sub infix:<does>(Mu, Mu, *%) { * }
multi sub infix:<does>(Mu:D \obj, Mu:U \rolish) is rw {
# XXX Mutability check.
Expand All @@ -24,14 +29,14 @@ multi sub infix:<does>(Mu:D \obj, Mu:U \rolish, :$value! is parcel) is rw {
mixedin.BUILD_LEAST_DERIVED({ substr(mixedin.^mixin_attribute.Str,2) => $value });
}
multi sub infix:<does>(Mu:U \obj, Mu:U \role) is rw {
X::Does::TypeObject.new().throw
X::Does::TypeObject.new(type => obj).throw
}
multi sub infix:<does>(Mu:D \obj, @roles) is rw {
# XXX Mutability check.
obj.HOW.mixin(obj, |@roles).BUILD_LEAST_DERIVED({});
}
multi sub infix:<does>(Mu:U \obj, @roles) is rw {
X::Does::TypeObject.new().throw
X::Does::TypeObject.new(type => obj).throw
}

proto sub infix:<but>(Mu, Mu, *%) { * }
Expand Down
3 changes: 2 additions & 1 deletion tools/build/Makefile-JVM.in
Expand Up @@ -124,8 +124,9 @@ J_CORE_SOURCES = \
src/core/IO.pm \
src/core/IO/Pathy.pm \
src/core/IO/Local.pm \
src/core/IO/Dir.pm \
src/core/IO/File.pm \
src/core/IO/Dir.pm \
src/core/IO/Symlink.pm \
src/core/IOU.pm \
src/core/IO/Spec.pm \
src/core/IO/Spec/Unix.pm \
Expand Down
1 change: 1 addition & 0 deletions tools/build/Makefile-Parrot.in
Expand Up @@ -209,6 +209,7 @@ P_CORE_SOURCES = \
src/core/IO/Local.pm \
src/core/IO/Dir.pm \
src/core/IO/File.pm \
src/core/IO/Symlink.pm \
src/core/IOU.pm \
src/core/IO/Spec.pm \
src/core/IO/Spec/Unix.pm \
Expand Down
1 change: 1 addition & 0 deletions tools/build/moar_core_sources
Expand Up @@ -74,6 +74,7 @@ src/core/IO/Pathy.pm
src/core/IO/Local.pm
src/core/IO/Dir.pm
src/core/IO/File.pm
src/core/IO/Symlink.pm
src/core/IOU.pm
src/core/IO/Spec.pm
src/core/IO/Spec/Unix.pm
Expand Down

0 comments on commit 727f247

Please sign in to comment.