Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tweaks for new unit declarator
  • Loading branch information
TimToady committed May 15, 2015
1 parent 159f61d commit 1c4b217
Show file tree
Hide file tree
Showing 26 changed files with 28 additions and 35 deletions.
2 changes: 1 addition & 1 deletion S02-lexical-conventions/sub-block-parsing.t
Expand Up @@ -43,7 +43,7 @@ throws_like { EVAL q[
# RT #85844
{
throws_like { EVAL 'sub foo;' },
X::SemicolonForm::Invalid,
X::UnitScope::Invalid,
'RT #85844';
}

Expand Down
6 changes: 3 additions & 3 deletions S06-other/main-semicolon.t
Expand Up @@ -24,17 +24,17 @@ is &?ROUTINE.name, "MAIN", "...and we're actually in MAIN now";

{
throws_like { EVAL "module AtBeginning \{\}\nsub MAIN;" },
X::SemicolonForm::TooLate, what => "sub"
X::UnitScope::TooLate, what => "sub"
}

{
throws_like { EVAL '{ sub MAIN; }' },
X::SemicolonForm::Invalid, what => "sub"
X::UnitScope::Invalid, what => "sub"
}

{
throws_like { EVAL 'multi sub MAIN;' },
X::SemicolonForm::Invalid, what => "sub"
X::UnitScope::Invalid, what => "sub"
}

# vim: ft=perl6
2 changes: 1 addition & 1 deletion S10-packages/precompilation.t
Expand Up @@ -111,7 +111,7 @@ unlink $_ for @precomp-paths; # don't care if worked

is_run
"use $module-name;
class C does Bar { };",
unit class C does Bar { };",
{ err => '',
out => '',
status => 0,
Expand Down
2 changes: 1 addition & 1 deletion S11-modules/InnerModule.pm
@@ -1,4 +1,4 @@
module InnerModule;
unit module InnerModule;
use v6;

sub foo is export(:DEFAULT) {'Inner::foo'}
Expand Down
2 changes: 1 addition & 1 deletion S11-modules/OuterModule.pm
@@ -1,4 +1,4 @@
module OuterModule;
unit module OuterModule;
use v6;

use InnerModule :ALL :EXPORT;
2 changes: 1 addition & 1 deletion S24-testing/use_ok_test.pm
@@ -1,3 +1,3 @@
module use_ok_test-0.0.1;
unit module use_ok_test-0.0.1;

sub it_worked { 1 }
2 changes: 1 addition & 1 deletion S32-exceptions/misc.t
Expand Up @@ -256,7 +256,7 @@ throws_like 'sub f() { }; &f.unwrap("foo")', X::Routine::Unwrap;
throws_like 'my %h = 1', X::Hash::Store::OddNumber;

# TOOD: might be X::Syntax::Malformed too...
throws_like 'sub foo;', X::SemicolonForm::Invalid, what => 'sub';
throws_like 'sub foo;', X::UnitScope::Invalid, what => 'sub';
# RT #75776
throws_like 'my $d; my class A {method x { $d }}; for () { sub }', X::Syntax::Missing, what => 'block';
throws_like 'constant foo;', X::Syntax::Missing, what => /initializer/;
Expand Down
2 changes: 1 addition & 1 deletion integration/advent2011-day15.t
Expand Up @@ -38,7 +38,7 @@ for @inputs Z @results Z @expected -> ($input, $result, $expected) {
or diag "got: $result";
}

try EVAL q[ class A; method { $!x } ];
try EVAL q[ unit class A; method { $!x } ];
is $!, 'Attribute $!x not declared in class A', 'compiler error message';
isa-ok $!, X::Attribute::Undeclared, 'compiler error class';
ok $! ~~ X::Comp, 'compile error does X::Comp';
Expand Down
2 changes: 1 addition & 1 deletion packages/A/B.pm
@@ -1,6 +1,6 @@
# used in t/spec/S11-modules/nested.t

module A::B;
unit module A::B;
role B { };
class D does A::B::B { };

Expand Down
2 changes: 1 addition & 1 deletion packages/ArrayInit.pm
@@ -1,4 +1,4 @@
module ArrayInit;
unit module ArrayInit;

# used by t/spec/S10-packages/basic.t

Expand Down
2 changes: 1 addition & 1 deletion packages/B/Grammar.pm
@@ -1,3 +1,3 @@
grammar B::Grammar {
unit grammar B::Grammar {
token TOP { 'B' };
}
2 changes: 1 addition & 1 deletion packages/Bar.pm
Expand Up @@ -2,7 +2,7 @@ use v6;

use Foo;

class Bar is ::Foo;
unit class Bar is ::Foo;

method bar { "bar" }

2 changes: 1 addition & 1 deletion packages/Exportops.pm
@@ -1,4 +1,4 @@
module Exportops;
unit module Exportops;

sub postfix:<!>(Int $x) is export(:DEFAULT) { [*] 1..$x }
sub infix:<yadayada>($a, $b) is export(:DEFAULT) { $a ~ ".." ~ $b }
Expand Down
2 changes: 1 addition & 1 deletion packages/Foo.pm
@@ -1,7 +1,7 @@
use v6;


class Foo;
unit class Foo;

method foo { "foo" }

Expand Down
2 changes: 1 addition & 1 deletion packages/FooBar.pm
Expand Up @@ -2,6 +2,6 @@ use v6;

use Bar;

class FooBar is ::Bar;
unit class FooBar is ::Bar;

method foobar { "foobar" }
2 changes: 1 addition & 1 deletion packages/Import.pm
@@ -1,2 +1,2 @@
module t::spec::packages::Import;
unit module t::spec::packages::Import;
# note the absence of a sub import() { }
2 changes: 1 addition & 1 deletion packages/LoadCounter.pm
@@ -1,6 +1,6 @@
use v6;

module t::packages::LoadCounter;
unit module t::packages::LoadCounter;

$Main::loaded++;

Expand Down
9 changes: 1 addition & 8 deletions packages/PackageTest.pm
@@ -1,9 +1,4 @@
# The semicolon form of "package" would be illegal in the
# middle of a Perl 6 file.
# At the top, it would mean the rest of the file was Perl 5 code.
# So we use "package" with a block:

package t::spec::packages::PackageTest {
unit package t::spec::packages::PackageTest;

sub ns { "t::spec::packages::PackageTest" }

Expand Down Expand Up @@ -37,5 +32,3 @@ sub cant_see_pkg {
}

sub dummy_sub_with_params($arg1, $arg2) is export { "[$arg1] [$arg2]" }

}
2 changes: 1 addition & 1 deletion packages/RT84280.pm
@@ -1,4 +1,4 @@
module RT84280;
unit module RT84280;

sub foo(Str $a) is export {
}
Expand Down
2 changes: 1 addition & 1 deletion packages/RequireAndUse3.pm
Expand Up @@ -5,6 +5,6 @@ use v6;
# started by Ingo Blechschmidt,
# L<"http://www.nntp.perl.org/group/perl.perl6.language/22258">.

module t::spec::packages::RequireAndUse3;
unit module t::spec::packages::RequireAndUse3;

23;
2 changes: 1 addition & 1 deletion packages/RoleA.pm
@@ -1,6 +1,6 @@
use lib 't/spec/packages';
use RoleB;

role RoleA;
unit role RoleA;

# vim: ft=perl6
2 changes: 1 addition & 1 deletion packages/RoleB.pm
@@ -1,3 +1,3 @@
role RoleB;
unit role RoleB;

# vim: ft=perl6
2 changes: 1 addition & 1 deletion packages/S11-modules/Foo.pm
@@ -1,6 +1,6 @@
# L<S11/"Exportation"/>

module t::spec::packages::S11-modules::Foo;
unit module t::spec::packages::S11-modules::Foo;
sub foo is export(:DEFAULT) { 'Foo::foo' } # :DEFAULT, :ALL
sub bar is export(:DEFAULT, :others) { 'Foo::bar' } # :DEFAULT, :ALL, :others
sub baz is export(:MANDATORY) { 'Foo::baz' } # (always exported)
Expand Down
2 changes: 1 addition & 1 deletion packages/Test/Compile.pm
@@ -1,4 +1,4 @@
module Test::Compile;
unit module Test::Compile;
use nqp;
use Test;

Expand Down
2 changes: 1 addition & 1 deletion packages/Test/Tap.pm
@@ -1,4 +1,4 @@
module Test::Tap;
unit module Test::Tap;

use Test;

Expand Down
2 changes: 1 addition & 1 deletion packages/Test/Util.pm
@@ -1,4 +1,4 @@
module Test::Util;
unit module Test::Util;

use Test;

Expand Down

0 comments on commit 1c4b217

Please sign in to comment.