| 1 | package Zuzu::AST::Role::Node; | ||
| 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::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 78 | has 'file' => ( is => 'rw' ); | |
| 10 | 78 | has 'line' => ( is => 'rw' ); | |
| 11 | |||
| 12 | 78 | requires 'evaluate'; | |
| 13 | |||
| 14 | =pod | ||
| 15 | |||
| 16 | =head1 NAME | ||
| 17 | |||
| 18 | Zuzu::AST::Role::Node - role implemented by all AST nodes | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | Defines the common C<evaluate> interface and source-location | ||
| 23 | metadata contract for AST node classes. | ||
| 24 | |||
| 25 | =head1 ATTRIBUTES | ||
| 26 | |||
| 27 | =head2 file | ||
| 28 | |||
| 29 | Type: B<Maybe[Str]>. | ||
| 30 | |||
| 31 | Source filename used for diagnostics. | ||
| 32 | |||
| 33 | =head2 line | ||
| 34 | |||
| 35 | Type: B<Int>. | ||
| 36 | |||
| 37 | 1-based source line number used for diagnostics. | ||
| 38 | |||
| 39 | =head1 SEE ALSO | ||
| 40 | |||
| 41 | C<Zuzu::AST::Program>, | ||
| 42 | C<Zuzu::AST::Block>, | ||
| 43 | C<Zuzu::AST::Stmt::Let>, | ||
| 44 | C<Zuzu::AST::Stmt::Assign>, | ||
| 45 | C<Zuzu::AST::Stmt::If>, | ||
| 46 | C<Zuzu::AST::Stmt::While>, | ||
| 47 | C<Zuzu::AST::Stmt::For>, | ||
| 48 | C<Zuzu::AST::Stmt::Function>, | ||
| 49 | C<Zuzu::AST::Stmt::Return>, | ||
| 50 | C<Zuzu::AST::Stmt::Next>, | ||
| 51 | C<Zuzu::AST::Stmt::Last>, | ||
| 52 | C<Zuzu::AST::Stmt::Expr>, | ||
| 53 | C<Zuzu::AST::Stmt::Import>, | ||
| 54 | C<Zuzu::AST::Expr::Literal>, | ||
| 55 | C<Zuzu::AST::Expr::Var>, | ||
| 56 | C<Zuzu::AST::Expr::Binary>, | ||
| 57 | C<Zuzu::AST::Expr::Unary>, | ||
| 58 | C<Zuzu::AST::Expr::Call>, | ||
| 59 | C<Zuzu::AST::Expr::MemberCall>, | ||
| 60 | C<Zuzu::AST::Expr::Index>, | ||
| 61 | C<Zuzu::AST::Expr::DictGet>, | ||
| 62 | C<Zuzu::AST::Expr::Array>, | ||
| 63 | C<Zuzu::AST::Expr::Dict>. | ||
| 64 | |||
| 65 | =head1 COPYRIGHT AND LICENCE | ||
| 66 | |||
| 67 | B<< Zuzu::AST::Role::Node >> is copyright Toby Inkster. | ||
| 68 | |||
| 69 | It is free software; you may redistribute it and/or modify it under | ||
| 70 | the terms of either the Artistic License 1.0 or the GNU General Public | ||
| 71 | License version 2. | ||
| 72 | |||
| 73 | =cut | ||
| 74 | |||
| 75 | 78 | 1; | |