| 1 | package Zuzu::AST::Stmt::Trait; | ||
| 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 'name' => ( is => 'rw' ); | |
| 10 | 78 | has 'methods' => ( is => 'rw' ); | |
| 11 | |||
| 12 | 78 | with 'Zuzu::AST::Role::Node'; | |
| 13 | |||
| 14 | 68 | ▶ | sub evaluate { $_[1]->eval_trait_def($_[0]) } |
|
Subroutine
evaluate: called CC=1 SCAR=0.0
Pod
documented
| |||
| 15 | |||
| 16 | =pod | ||
| 17 | |||
| 18 | =head1 NAME | ||
| 19 | |||
| 20 | Zuzu::AST::Stmt::Trait - AST node for trait declarations | ||
| 21 | |||
| 22 | =head1 DESCRIPTION | ||
| 23 | |||
| 24 | Represents a trait declaration, including the trait's method | ||
| 25 | definitions. | ||
| 26 | |||
| 27 | =head1 INHERITANCE | ||
| 28 | |||
| 29 | Inherits from C<Moo::Object>. | ||
| 30 | |||
| 31 | =head1 ROLES | ||
| 32 | |||
| 33 | Consumes C<Zuzu::AST::Role::Node>. | ||
| 34 | |||
| 35 | =head1 ATTRIBUTES | ||
| 36 | |||
| 37 | =head2 name | ||
| 38 | |||
| 39 | Type: B<Str>. | ||
| 40 | |||
| 41 | Identifier name declared or referenced by the node/value. | ||
| 42 | |||
| 43 | =head2 methods | ||
| 44 | |||
| 45 | Type: B<ArrayRef[InstanceOf["Zuzu::AST::Stmt::Method"]]>. | ||
| 46 | |||
| 47 | Instance methods contributed by this trait. | ||
| 48 | |||
| 49 | =head1 METHODS | ||
| 50 | |||
| 51 | =head2 evaluate | ||
| 52 | |||
| 53 | Dispatches this AST node to the matching runtime evaluator. | ||
| 54 | |||
| 55 | =head1 SEE ALSO | ||
| 56 | |||
| 57 | C<Zuzu::AST::Role::Node>. | ||
| 58 | |||
| 59 | Subclasses: none in this distribution. | ||
| 60 | |||
| 61 | =head1 COPYRIGHT AND LICENCE | ||
| 62 | |||
| 63 | B<< Zuzu::AST::Stmt::Trait >> is copyright Toby Inkster. | ||
| 64 | |||
| 65 | It is free software; you may redistribute it and/or modify it under | ||
| 66 | the terms of either the Artistic License 1.0 or the GNU General Public | ||
| 67 | License version 2. | ||
| 68 | |||
| 69 | =cut | ||
| 70 | |||
| 71 | 78 | 1; | |