| 1 | package Zuzu::AST::Stmt::Try; | ||
| 2 | |||
| 3 | 78 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 78 | our $VERSION = '0.007002'; | |
| 6 | |||
| 7 | 78 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 78 | has 'block' => ( is => 'rw' ); | |
| 10 | 0 | ▶ | has 'catches' => ( is => 'rw', default => sub { [] } ); |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||
| 11 | |||
| 12 | 78 | with 'Zuzu::AST::Role::Node'; | |
| 13 | |||
| 14 | 56 | ▶ | sub evaluate { $_[1]->eval_try($_[0]) } |
|
Subroutine
evaluate: called CC=1 SCAR=0.0
Pod
documented
| |||
| 15 | |||
| 16 | =pod | ||
| 17 | |||
| 18 | =head1 NAME | ||
| 19 | |||
| 20 | Zuzu::AST::Stmt::Try - AST node for try/catch statements | ||
| 21 | |||
| 22 | =head1 DESCRIPTION | ||
| 23 | |||
| 24 | Represents one statement form in the abstract syntax tree and delegates execution to C<Zuzu::Runtime>. | ||
| 25 | |||
| 26 | =head1 INHERITANCE | ||
| 27 | |||
| 28 | Inherits from C<Moo::Object>. | ||
| 29 | |||
| 30 | =head1 ROLES | ||
| 31 | |||
| 32 | Consumes C<Zuzu::AST::Role::Node>. | ||
| 33 | |||
| 34 | =head1 ATTRIBUTES | ||
| 35 | |||
| 36 | =head2 block | ||
| 37 | |||
| 38 | Type: B<InstanceOf["Zuzu::AST::Block"]>. | ||
| 39 | |||
| 40 | Try block body that may throw and be caught by clauses. | ||
| 41 | |||
| 42 | =head2 catches | ||
| 43 | |||
| 44 | Type: B<ArrayRef[InstanceOf["Zuzu::AST::Stmt::Catch"]]>. | ||
| 45 | |||
| 46 | Ordered catch clauses that are tested left-to-right. | ||
| 47 | |||
| 48 | =head1 METHODS | ||
| 49 | |||
| 50 | =head2 evaluate | ||
| 51 | |||
| 52 | Dispatches this AST node to the matching runtime evaluator. | ||
| 53 | |||
| 54 | =head1 SEE ALSO | ||
| 55 | |||
| 56 | C<Zuzu::AST::Role::Node>. | ||
| 57 | |||
| 58 | Subclasses: none in this distribution. | ||
| 59 | |||
| 60 | =head1 COPYRIGHT AND LICENCE | ||
| 61 | |||
| 62 | B<< Zuzu::AST::Stmt::Try >> is copyright Toby Inkster. | ||
| 63 | |||
| 64 | It is free software; you may redistribute it and/or modify it under | ||
| 65 | the terms of either the Artistic License 1.0 or the GNU General Public | ||
| 66 | License version 2. | ||
| 67 | |||
| 68 | =cut | ||
| 69 | |||
| 70 | 78 | 1; | |