Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Perlito5 - perl6 - sub cleanup
  • Loading branch information
fglock committed Oct 15, 2013
1 parent 66a0327 commit c3c420e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion perlito5.pl
Expand Up @@ -12812,7 +12812,10 @@ package Perlito5::AST::Sub;
if defined($self->{'block'});
return(['op' => 'prefix:<sub>', @parts])
if !$self->{'name'};
return(['stmt' => ['keyword' => 'sub'], ['bareword' => $self->{'namespace'} . '::' . $self->{'name'}], @parts])
my $name = $self->{'name'};
$name = $self->{'namespace'} . '::' . $name
if $Perlito5::PKG_NAME ne $self->{'namespace'};
return(['stmt' => ['keyword' => 'sub'], ['bareword' => $name], @parts])
}
}
package Perlito5::AST::Do;
Expand Down
7 changes: 6 additions & 1 deletion src5/lib/Perlito5/Perl6/Emitter.pm
Expand Up @@ -672,7 +672,12 @@ package Perlito5::AST::Sub;
push @parts, Perlito5::Perl6::emit_perl6_block($self->{block})
if defined $self->{block};
return [ op => 'prefix:<sub>', @parts ] if !$self->{name};
return [ stmt => [ keyword => 'sub' ], [ bareword => $self->{namespace} . "::" . $self->{name} ], @parts ];

my $name = $self->{name};
$name = $self->{namespace} . "::" . $name
if $Perlito5::PKG_NAME ne $self->{namespace};

return [ stmt => [ keyword => 'sub' ], [ bareword => $name ], @parts ];
}
}

Expand Down

0 comments on commit c3c420e

Please sign in to comment.