Skip to content

Instantly share code, notes, and snippets.

@mlschroe
Created September 20, 2011 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlschroe/1229760 to your computer and use it in GitHub Desktop.
Save mlschroe/1229760 to your computer and use it in GitHub Desktop.
diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm
index e5e6caf..fbff596 100644
--- a/src/Perl6/Actions.pm
+++ b/src/Perl6/Actions.pm
@@ -3728,26 +3728,22 @@ class Perl6::Actions is HLL::Actions {
unless $block.handlers() {
$block.handlers([]);
}
- $handler := PAST::Block.new(
- :blocktype('declaration'),
- PAST::Var.new( :scope('parameter'), :name('$_') ),
+ my $handler_start := PAST::Stmts.new(
PAST::Op.new( :pasttype('bind_6model'),
- PAST::Var.new( :scope('lexical_6model'), :name('$_') ),
+ PAST::Var.new( :scope('lexical_6model'), :name('$_'), :isdecl(1) ),
PAST::Op.new(
:name('&EXCEPTION'),
- PAST::Var.new( :scope('lexical_6model'), :name('$_') ),
+ PAST::Var.new( :scope('parameter') ),
),
),
- PAST::Var.new( :scope('lexical_6model'), :name('$/'), :isdecl(1) ),
- PAST::Op.new( :pasttype('bind_6model'),
- PAST::Var.new( :scope('lexical_6model'), :name('$!'), :isdecl(1) ),
+ PAST::Op.new( :pirop('perl6_container_store__0PP'),
+ PAST::Op.new( :pirop('find_lex_skip_current Ps'), '$!'),
PAST::Var.new( :scope('lexical_6model'), :name('$_') ),
),
- PAST::Op.new( :pasttype('call'),
- $handler,
- ));
- $handler.symbol('$_', :scope('lexical_6model'));
- $handler.symbol('$!', :scope('lexical_6model'));
+ PAST::Var.new( :scope('lexical_6model'), :name('$!'), :isdecl(1) ),
+ PAST::Var.new( :scope('lexical_6model'), :name('$/'), :isdecl(1) ),
+ );
+ $handler<past_block>[1].unshift($handler_start);
$handler := PAST::Stmts.new(
PAST::Op.new( :pasttype('call'),
$handler,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment