VAST.pm untested

filter: Statementstmt 0.0% 0 / 33 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 44 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use v5.10;
2 use Carp;
3 use MooseX::Declare;
4 {
5 package VAST;
6 BEGIN {
7 $VAST::VERSION = '0.05';
8 }
9 use Module::Pluggable sub_name=>"subclasses",search_path=>["VAST"],require=>1;
10 # load all the VAST::* subclasses
11 VAST->subclasses;
12 }
13 class VAST::Base {
14 method emit_m0ld {
15 use Mildew::AST::Helpers;
16 if ($self->{infix}) {
17 my $name = $self->{infix}{SYM};
18 return fcall('&infix:'.$name,[map {$_->emit_m0ld} @{$self->{args}}]);
19 }
20 my @keys = grep {/^[a-z]\w*$/} keys %{$self};
21 if (@keys == 1) {
22 # say "falling back at ",ref $self," only key ",$keys[0];
23 $self->{$keys[0]}->emit_m0ld;
24 } else {
25 #XXX improve error message
26 die (ref $self," is not a simple node, possible choices are: ",join(' ',@keys));
27 }
28 }
29 }
30 1;