Skip to content
Browse files

Fix CATCH/CONTROL action methods; they are actually statement_control…

…, not _prefix, oops.
  • Loading branch information...
1 parent 1ce800e commit 83bb53b50d96087e6ee4de7e45fe789fb326a330 @sorear committed Aug 6, 2011
Showing with 3 additions and 6 deletions.
  1. +3 −6 src/niecza
View
9 src/niecza
@@ -199,13 +199,10 @@ method statement_control:TEMP ($/) {
method prefix:let ($/) { make ::Operator::Let.new }
sub phaser($/, $ph, :$unique, :$topic, :$csp) {
- my $sub = $<blast>.ast;
+ my $sub = ($<blast> // $<block>).ast;
$sub.outer.noninlinable;
$sub.is_phaser = +::Metamodel::Phaser.($ph);
- $/.CURSOR.sorry("Limit one $ph phaser per block, please.")
- if $unique && any($sub.outer.children).is_phaser == $sub.is_phaser;
-
if $topic {
$sub.lexicals.<$_> // $sub.add_my_name('$_');
$sub.lexicals.<$_>.noinit = True;
@@ -215,8 +212,8 @@ sub phaser($/, $ph, :$unique, :$topic, :$csp) {
$*CURLEX<!sub>.create_static_pad if $csp;
make ::Op::StatementList.new;
}
-method statement_prefix:CATCH ($/) { phaser($/, 'CATCH', :unique, :topic) }
-method statement_prefix:CONTROL ($/) { phaser($/, 'CONTROL', :unique, :topic) }
+method statement_control:CATCH ($/) { phaser($/, 'CATCH', :unique, :topic) }
+method statement_control:CONTROL ($/) { phaser($/, 'CONTROL', :unique, :topic) }
method statement_prefix:PRE ($/) { phaser($/, 'PRE') }
method statement_prefix:POST ($/) { phaser($/, 'POST', :topic) }
method statement_prefix:KEEP ($/) { phaser($/, 'KEEP', :topic) }

0 comments on commit 83bb53b

Please sign in to comment.
Something went wrong with that request. Please try again.