| 1 | package Language::MinCaml::Type; | ||
| 2 | 6 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 6 | ▶ | use base qw(Class::Accessor::Fast Exporter); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 6 | __PACKAGE__->mk_accessors(qw(kind children)); | |
| 6 | |||
| 7 | 6 | our @EXPORT = qw(Type_Unit Type_Bool Type_Int Type_Float Type_Tuple | |
| 8 | Type_Array Type_Var Type_Fun); | ||
| 9 | |||
| 10 | 6 | for my $routine_name (@EXPORT){ | |
| 11 | 48 | my $routine; | |
| 12 | 48 | my $kind = $routine_name; | |
| 13 | 48 | $kind =~ s/^Type_//; | |
| 14 | 0 | ▶ | $routine = sub { __PACKAGE__->new($kind, @_); }; |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||
| 15 | 6 | ▶ | no strict 'refs'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 48 | *{$routine_name} = $routine; | |
| 17 | } | ||
| 18 | |||
| 19 | 1 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 20 | 1 | my($class, $kind, @children) = @_; | |
| 21 | 1 | return bless { kind => $kind, children => \@children }, $class; | |
| 22 | } | ||
| 23 | |||
| 24 | 6 | 1; | |