| 1 | package Zuzu::AST::Stmt::Let; | ||
| 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 'init' => ( is => 'rw' ); | |
| 11 | 78 | has 'is_const' => ( is => 'rw' ); | |
| 12 | 0 | ▶ | has 'declared_type' => ( is => 'rw', default => sub { 'Any' } ); |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||
| 13 | 0 | ▶ | has 'is_weak_storage' => ( is => 'rw', default => sub { 0 } ); |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||
| 14 | |||
| 15 | 78 | with 'Zuzu::AST::Role::Node'; | |
| 16 | |||
| 17 | 47733 | ▶ | sub evaluate { |
|
Subroutine
evaluate: called CC=1 SCAR=0.0
Pod
documented
| |||
| 18 | 78 | ▶ | no warnings 'recursion'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | 47733 | $_[1]->eval_let($_[0]) | |
| 20 | } | ||
| 21 | |||
| 22 | =pod | ||
| 23 | |||
| 24 | =head1 NAME | ||
| 25 | |||
| 26 | Zuzu::AST::Stmt::Let - AST node for let statements | ||
| 27 | |||
| 28 | =head1 DESCRIPTION | ||
| 29 | |||
| 30 | Represents one statement form in the abstract syntax tree and delegates execution to C<Zuzu::Runtime>. | ||
| 31 | |||
| 32 | =head1 INHERITANCE | ||
| 33 | |||
| 34 | Inherits from C<Moo::Object>. | ||
| 35 | |||
| 36 | =head1 ROLES | ||
| 37 | |||
| 38 | Consumes C<Zuzu::AST::Role::Node>. | ||
| 39 | |||
| 40 | =head1 ATTRIBUTES | ||
| 41 | |||
| 42 | =head2 name | ||
| 43 | |||
| 44 | Type: B<Str>. | ||
| 45 | |||
| 46 | Identifier name declared or referenced by the node/value. | ||
| 47 | |||
| 48 | =head2 init | ||
| 49 | |||
| 50 | Type: B<Maybe[ConsumerOf["Zuzu::AST::Role::Node"]]>. | ||
| 51 | |||
| 52 | Initializer expression for declarations, if present. | ||
| 53 | |||
| 54 | =head2 is_const | ||
| 55 | |||
| 56 | Type: B<Bool>. | ||
| 57 | |||
| 58 | True when the declared binding is immutable. | ||
| 59 | |||
| 60 | =head1 METHODS | ||
| 61 | |||
| 62 | =head2 evaluate | ||
| 63 | |||
| 64 | Dispatches this AST node to the matching runtime evaluator. | ||
| 65 | |||
| 66 | =head1 SEE ALSO | ||
| 67 | |||
| 68 | C<Zuzu::AST::Role::Node>. | ||
| 69 | |||
| 70 | Subclasses: none in this distribution. | ||
| 71 | |||
| 72 | =head1 COPYRIGHT AND LICENCE | ||
| 73 | |||
| 74 | B<< Zuzu::AST::Stmt::Let >> is copyright Toby Inkster. | ||
| 75 | |||
| 76 | It is free software; you may redistribute it and/or modify it under | ||
| 77 | the terms of either the Artistic License 1.0 or the GNU General Public | ||
| 78 | License version 2. | ||
| 79 | |||
| 80 | =cut | ||
| 81 | |||
| 82 | 78 | 1; | |