sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(LWP)'
sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(Text::Levenshtein::XS)'
sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(Term::Term:)'
-sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(Term::ReadKey)'
sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(Term::Screen)'
+sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(Term::ReadKey)'
sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(Exception::Class)'
sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(Syntax::Keyword::Try)'
sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(JSON::XS)'
sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(DBI)'
sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(DBD::SQLite)'
-# sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(DBD::Pg)'
-# sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(DBD::mysql)'
+sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(DBD::Pg)'
+sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(DBD::mysql)'
sudo perl -MCPAN -Mlocal::lib -e 'CPAN::install(CGI::Session)'
sudo apt install libanyevent-perl libclass-refresh-perl libcompiler-lexer-perl \
if(!$p){
$p = $itm;
}else{
- $itm =~ s/^\s*(['"])(.*)\g{1}$/$2/g if $itm; $itm =~ s/\s*$//;
+ $itm =~ s/^\s*(['"])(.*)\g{1}$/$2/g if $itm; $itm =~ s/\s*$//;
$self->{$p}=$itm;
undef $p;
}
}
}elsif($t eq 'FILE'){#@TODO Test case this
$self->doLoadDataFile($e,$v);
- }elsif($t eq 'INCLUDE'){
- my $isMetaConst = $v =~ s/$meta_const//s;
+ }elsif($t eq 'INCLUDE'){
if (!$v){
- $v=$e
+ $v=$e
}else{
+ my $isMetaConst = $v =~ s/$meta_const//s;
if ($isMetaConst){
$self -> {$e} = $v;
}else{
}
$includes[@includes] = {script=>$v,local=>$CUR_SCRIPT,loaded=>0, prc_last=>$prc_last};
}elsif($t eq 'TREE'){
- my $tree = 0;
+ my $tree = 0;
if( !$v ){
$v = $e;
$e = CNFMeta::ANN();
sub parse { my ($self, $cnf_file, $content, $del_keys) = @_;
my @tags;
- $cnf_file = $cnf_file -> {path} if ref($cnf_file) eq 'CNFGlobalFile';
-
- # We control from here the constances, as we need to unlock them if a previous parse was run.
+ # We control from here the constances, as we need to unlock them if a previous parse was run.
unlock_hash(%$self);
if(not $content){
+ $cnf_file = $cnf_file -> {path} if ref($cnf_file) eq 'CNFGlobalFile';
open(my $fh, "<:perlio", $cnf_file ) or die "Can't open $cnf_file -> $!";
read $fh, $content, -s $fh;
close $fh;
# Do scripted includes first. As these might set properties imported and processed used by the main script.
if(@includes){
$includes[@includes] = {script=>$CUR_SCRIPT,loaded=>1, prc_last=>0} if not includeContains($CUR_SCRIPT); #<- to prevent circular includes.
- foreach (@includes){
- $self -> doInclude($_) if $_ && not $_->{prc_last} and not $_->{loaded} and $_->{local} eq $CUR_SCRIPT;
+ my $hook = $self->{INCLUDES_LISTENER};
+ foreach my $include (@includes){
+ if ($include && not $include->{prc_last} and not $include->{loaded} and $include->{local} eq $CUR_SCRIPT){
+ $hook -> ($CUR_SCRIPT,$include->{script}) if $hook;
+ $self -> doInclude($include); #<- These might include new includes, not worried about to hook on, as would be to deep.
+ }
}
}
# Do those autonumbering list anons, and for pre instruction processing prepare if have it.
$anechoic ->{$struct->name()} = $struct->process($self, $struct->script());
$self->log("Processed -> ".$struct->name()) if $self->{DEBUG}
}
- $splice[@splice] = $idx - @splice;
+ $splice[@splice] = $idx - @splice;
}elsif($type eq 'InstructedDataItem' && $priority > 0 && $priority < 5){
my $t = $struct->{ins};
if($t eq 'PLUGIN'){
instructPlugin($self, $struct);
- $splice[@splice] = $idx - @splice;
+ $splice[@splice] = $idx - @splice;
}
}
}
}
-
+
foreach my $i(@splice){ splice(@items, $i, 1) }
#Now only what is left instructed data items or plugins, and nodes that have assigned last priority, if any.
$IS_IN_INCLUDE_MODE = 0;
$CUR_SCRIPT = $cur_script;
}else{
- $self->error("Include content is blank for include -> ".$prp_file->{script})
+ $self->error("Include content is blank for -> ".$prp_file->{script})
}
}else{
$prp_file->{loaded} = 0;
- $self->error("Script include not available for include -> ".$prp_file->{script});
+ $self->error("Script include not available for -> ".$prp_file->{script});
CNFParserException->throw("Can't open include ".$prp_file->{script}." -> $!") if $self->{STRICT};
}
}