Skip to content

Commit

Permalink
[dotnet] Add DNST::TryCatch and DNST::Throw nodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Oct 21, 2010
1 parent 588770d commit e47a5fb
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions dotnet/compiler/DNST.pm
Expand Up @@ -231,6 +231,36 @@ class DNST::TryFinally is DNST::Node {
}
}

class DNST::TryCatch is DNST::Node {
has $!exception_type;
has $!exception_var;

method exception_type($set?) {
if $set { $!exception_type := $set }
$!exception_type
}

method exception_var($set?) {
if $set { $!exception_var := $set }
$!exception_var
}

method new(*@children, :$exception_type!, :$exception_var!) {
my $obj := self.CREATE;
$obj.exception_type($exception_type);
$obj.exception_var($exception_var);
$obj.set_children(@children);
$obj;
}
}

class DNST::Throw is DNST::Node {
method new() {
my $obj := self.CREATE;
$obj;
}
}

class DNST::If is DNST::Node {
method new(*@children) {
my $obj := self.CREATE;
Expand Down

0 comments on commit e47a5fb

Please sign in to comment.