Skip to content

Commit

Permalink
[mm] Implement bare blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Sep 19, 2010
1 parent 3b8eaf3 commit fad06e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/Metamodel.pm
Expand Up @@ -472,6 +472,13 @@ sub Op::SubDef::begin {
delete $self->{$_} for (qw( body method_too proto_too exports once ));
}

sub Op::BareBlock::begin {
my $self = shift;
my $body = $self->body->begin;
$opensubs[-1]->add_my_sub($self->var, $body);
delete $self->{$_} for (qw( body ));
}

sub Op::WhateverCode::begin {
my $self = shift;
my $body = Body->new(name => 'ANON', transparent => 1, do => $self->ops,
Expand Down
5 changes: 0 additions & 5 deletions src/Op.pm
Expand Up @@ -747,11 +747,6 @@ use CgOp;
has var => (isa => 'Str', is => 'ro', required => 1);
has body => (isa => 'Body', is => 'ro', required => 1);

sub lift_decls {
my ($self) = @_;
Decl::Sub->new(var => $self->var, code => $self->body);
}

sub code {
my ($self, $body) = @_;
CgOp::scopedlex($self->var);
Expand Down

0 comments on commit fad06e5

Please sign in to comment.