Skip to content

Commit

Permalink
Make sure compose-time errors get line/file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Dec 18, 2015
1 parent 48f4c14 commit c31190e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/Perl6/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,7 @@ class Perl6::Actions is HLL::Actions does STDActions {

# Compose before we add the role to the group, so the group sees
# it composed.
$*W.pkg_compose($*PACKAGE);
$*W.pkg_compose($/, $*PACKAGE);

# Add this role to the group if needed.
my $group := $*PACKAGE.HOW.group($*PACKAGE);
Expand All @@ -2536,7 +2536,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
}
else {
# Compose.
$*W.pkg_compose($*PACKAGE);
$*W.pkg_compose($/, $*PACKAGE);

# Finish code object for the block.
my $code := $*CODE_OBJECT;
Expand Down Expand Up @@ -4049,7 +4049,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
}
# Apply traits, compose and install package.
$*W.apply_traits($<trait>, $type_obj);
$*W.pkg_compose($type_obj);
$*W.pkg_compose($/, $type_obj);
}
my $base_type;
my int $has_base_type := 0;
Expand Down
10 changes: 5 additions & 5 deletions src/Perl6/World.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class Perl6::World is HLL::World {
else {
$*GLOBALish :=
self.pkg_create_mo($/,%*HOW<package>,:name('GLOBAL'));
self.pkg_compose($*GLOBALish);
self.pkg_compose($/, $*GLOBALish);
}

# Create or pull in existing EXPORT.
Expand All @@ -314,7 +314,7 @@ class Perl6::World is HLL::World {
}
else {
$*EXPORT := self.pkg_create_mo($/, %*HOW<package>, :name('EXPORT'));
self.pkg_compose($*EXPORT);
self.pkg_compose($/, $*EXPORT);
}

# If there's a self in scope, set $*HAS_SELF.
Expand Down Expand Up @@ -1137,7 +1137,7 @@ class Perl6::World is HLL::World {
else {
my $new_pkg := self.pkg_create_mo($/, self.resolve_mo($/, 'package'),
:name($longname));
self.pkg_compose($new_pkg);
self.pkg_compose($/, $new_pkg);
if $create_scope eq 'my' || $cur_lex {
self.install_lexical_symbol($cur_lex, $part, $new_pkg);
}
Expand Down Expand Up @@ -2669,8 +2669,8 @@ class Perl6::World is HLL::World {
}

# Composes the package, and stores an event for this action.
method pkg_compose($obj) {
$obj.HOW.compose($obj);
method pkg_compose($/, $obj) {
self.ex-handle($/, { $obj.HOW.compose($obj) })
}

# Builds a curried role based on a parsed argument list.
Expand Down

0 comments on commit c31190e

Please sign in to comment.