File Coverage

blib/lib/Mylisp/SppAst.pm
Criterion Covered Total %
statement 11 13 84.6
branch n/a
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 15 19 78.9


line stmt bran cond sub pod time code
1             package Mylisp::SppAst;
2            
3 1     1   21 use 5.012;
  1         4  
4 1     1   7 use experimental 'switch';
  1         3  
  1         7  
5            
6 1     1   143 use Exporter;
  1         3  
  1         99  
7             our @ISA = qw(Exporter);
8             our @EXPORT = qw(GetSppAst);
9            
10 1     1   8 use Mylisp::Estr;
  1         3  
  1         256  
11            
12             sub GetSppAst {
13 0     0 0   my $json = <<'EOF'
14             [["door",["Rules",[["Rept",["+",["Branch",[["Rept",["+",["Cclass","s"]]],["Rtoken","_comm"],["Ntoken","Spec"]]]]],["Blank","b"],["Assert","$"]]]],["_comm",["Rules",[["Char","#"],["Till",["Assert","$$"]]]]],["Spec",["Rules",[["Ntoken","Token"],["Blank","b"],["Str","->"],["Blank","b"],["Rept",["+",["Branch",[["Ntoken","Blank"],["Ntoken","Branch"],["Ctoken","atom"]]]]],["Branch",[["Cclass","v"],["Assert","$"]]]]]],["Blank",["Rept",["+",["Cclass","h"]]]],["atom",["Branch",[["Ntoken","Group"],["Ntoken","Token"],["Ntoken","Str"],["Ntoken","String"],["Ntoken","Kstr"],["Ntoken","Cclass"],["Ntoken","Char"],["Ntoken","Chclass"],["Ntoken","Sym"],["Ntoken","Expr"],["Ntoken","Assert"],["Ntoken","Any"],["Ntoken","Rept"],["Ntoken","Till"]]]],["Branch",["Rules",[["Char","|"],["Blank","b"],["Rept",["+",["Branch",[["Rept",["+",["Cclass","s"]]],["Rtoken","_comm"],["Ctoken","atom"]]]]],["Blank","b"],["Char","|"]]]],["Group",["Rules",[["Char","{"],["Blank","b"],["Rept",["+",["Branch",[["Rept",["+",["Cclass","s"]]],["Rtoken","_comm"],["Ntoken","Branch"],["Ctoken","atom"]]]]],["Blank","b"],["Char","}"]]]],["Token",["Rept",["+",["Chclass",[["Cclass","a"],["Cchar","-"]]]]]],["Kstr",["Rules",[["Char",":"],["Rept",["+",["Chclass",[["Cclass","a"],["Cchar","-"]]]]]]]],["Str",["Rules",[["Char","'"],["Rept",["+",["Branch",[["Rept",["+",["Nclass",[["Cchar","\\"],["Cchar","'"]]]]],["Group",[["Char","\\"],["Any","."]]]]]]],["Char","'"]]]],["String",["Rules",[["Char","\""],["Rept",["+",["Branch",[["Rept",["+",["Nclass",[["Cchar","\\"],["Cchar","\""]]]]],["Group",[["Char","\\"],["Any","."]]]]]]],["Char","\""]]]],["Cclass",["Rules",[["Char","\\"],["Chclass",[["Cchar","a"],["Cchar","d"],["Cchar","h"],["Cchar","l"],["Cchar","s"],["Cchar","u"],["Cchar","v"],["Cchar","w"],["Cchar","x"],["Cchar","A"],["Cchar","D"],["Cchar","H"],["Cchar","L"],["Cchar","S"],["Cchar","U"],["Cchar","V"],["Cchar","W"],["Cchar","X"]]]]]],["Char",["Rules",[["Char","\\"],["Any","."]]]],["Chclass",["Rules",[["Char","["],["Blank","b"],["Rept",["?",["Ntoken","Flip"]]],["Rept",["+",["Branch",[["Cclass","s"],["Ntoken","Cclass"],["Ntoken","Char"],["Ntoken","Range"],["Ntoken","Cchar"]]]]],["Blank","b"],["Char","]"]]]],["Flip",["Char","^"]],["Range",["Rules",[["Cclass","w"],["Char","-"],["Cclass","w"]]]],["Cchar",["Nclass",[["Cclass","s"],["Cchar","]"],["Cchar","#"],["Cchar","\\"]]]],["Assert",["Branch",[["Str","^^"],["Str","$$"],["Char","^"],["Char","$"]]]],["Any",["Char","."]],["Rept",["Chclass",[["Cchar","?"],["Cchar","*"],["Cchar","+"]]]],["Till",["Char","~"]],["Sym",["Rules",[["Chclass",[["Cchar","@"],["Cchar","$"]]],["Rept",["+",["Chclass",[["Cclass","a"],["Cchar","-"]]]]]]]],["Sub",["Rept",["+",["Chclass",[["Cclass","a"],["Cchar","-"]]]]]],["Expr",["Rules",[["Char","("],["Blank","b"],["Rept",["+",["Ctoken","eatom"]]],["Blank","b"],["Char",")"]]]],["Array",["Rules",[["Char","["],["Blank","b"],["Rept",["*",["Ctoken","eatom"]]],["Blank","b"],["Char","]"]]]],["eatom",["Branch",[["Ntoken","Array"],["Ntoken","Sub"],["Ntoken","Sym"],["Ntoken","Kstr"]]]]]
15             EOF
16             ;
17 0           return json_to_estr($json);
18             }
19             1;