use Hash::Util qw(lock_hash unlock_hash);
-use constant VERSION => '3.3.6';
+use constant VERSION => '3.3.7';
use constant APP_STS => 'APP_SETTINGS';
use constant APP_ARGS => 'ARGUMENTS';
###
# Validates and returns a constant named value as part of this configs instance.
-# Returns undef if it doesn't exist, and exception if constant required is set;
+# Returns undef if it doesn't exist, or empty and an exception
+# if constant required argument is set for this repository.
+###
sub const { my ($self,$c)=@_;
- return $self->{$c} if exists $self->{$c};
+ return $self->{$c} if exists $self->{$c} && $self->{$c} !~ m/\s*/s ;
if ($CONSTREQ){CNFParserException->throw("Required constants variable ' $c ' not defined in config!")}
# Let's try to resolve. As old convention makes constants have a '$' prefix all upprercase.
$c = '$'.$c;
return $self->{$c} if exists $self->{$c};
- return;
+ return undef;
}
###
# Validates if this repository contains expected and required constant.
}return;
}
-
#
#private to parser sub.
sub doProcessCollection{ my($self,$e,$t,$v) = @_;
my $isArray = $t=~ m/^@/;
my $IsConstant = ($v =~ s/$meta_const/""/sexi);
- my @lst = ($v =~ s/$meta_delimited// && $isArray?split(DELIMITER(), $v):split('\n', $v));
+ my @lst = ($v =~ s/$meta_delimited// || $isArray?split(DELIMITER(), $v):split('\n', $v));
my @props = map {
s/^\s+|\s+$//; # strip unwanted spaces
s/^\s*["']|['"]$//g;#strip quotes
foreach my $p(@props){
if($p && $p eq 'MACRO'){$macro=1}
elsif( $p && length($p)>0 ){
- my @pair = ($p=~/\s*([-+_\w]*)\s*[=:]\s*(.*)/s);#split(/\s*=\s*/, $p);
+ my @pair = ($p=~ m/\s*(^[.]\w*|[-+_\w]*)\s*[=:]\s*(.*)\s*/);#($p=~/\s*([-+_\w]*)\s*[=:]\s*(.*)/s);
next if (@pair != 2 || $pair[0] =~ m/^[#\\\/]+/m);#skip, it is a comment or not '=' delimited line.
my $name = $pair[0];
- my $value = $pair[1]; $value =~ s/^\s*["']|['"]$//g;#strip quotes
+ my $value = $pair[1]; $value =~ s/^\s*["']|['" ]$//;#strip quotes and trailing space
if($IsConstant && $p =~ m/\$[A-Z]+/){# if meta constant we check $p if signified to transfer into a CNF constance.
if(not exists $self->{$name}){
$self->{$name} = $value;
$line =~ s/^\s+|\s+$//; # strip unwanted spaces
$line =~ s/\s*#.*$//; #strip comment for end of line.
$line =~ s/\s*>$//;
- $line =~ m/([\$\w]*)(\s*=\s*)(.*)/g;
+ $line =~ m/([\$\w<>]*)(\s*=\s*)(.*)/;
my $name = $1;
$line = $3;
if($isVar && not $isMETAConst){
$anechoic ->{$name} = $line if $line
}else{
- $name =~ s/^\$// if $isMETAConst;
+ $name =~ s/^\$// if $isMETAConst;
+ if($name =~ m/^<(.*)>$/){
+ $name = $1; $line = CNF::_isTrue($line);
+ }
# It is NOT allowed to overwrite a constant, so check and issue warning.
if(not exists $self->{$name}){
$self->{$name} = $line;
}else{
- $self->warn("Skipped constant reassignment for '$name'.");
+ $self->warn("Skipped constant reassignment for '$name' previous exists.");
}
}
}
--- /dev/null
+.window-list-item-box {
+ padding: 0 6px;
+ color: #ffffffcc;
+ background-color: #e0d3d3;
+ background-gradient-start: #e0d3d3;
+ background-gradient-end: #3c2e2e;
+}
+
+.window-list-item-box.top,
+.window-list-item-box.bottom {
+ border-bottom-width: 2px;
+}
+
+.window-list-item-box.top StLabel,
+.window-list-item-box.bottom StLabel {
+ padding-left: 2px;
+}
+
+.window-list-item-box.right {
+ padding-left: 0;
+ padding-right: 0;
+ border-right-width: 2px;
+}
+
+.window-list-item-box.right StBin {
+ padding-right: 0;
+ padding-left: 5px;
+}
+
+.window-list-item-box.left {
+ padding-left: 0;
+ padding-right: 0;
+ border-left-width: 2px;
+}
+
+.window-list-item-box.left StBin {
+ padding-left: 0;
+ padding-right: 5px;
+}
+
+.window-list-item-box:hover {
+ background-color: #393939;
+}
+
+.window-list-item-box:focus {
+ border-color: #3584e4;
+ background-color: `
+}
+
+.window-list-item-box .progress {
+ background-color: rgba(143, 240, 164, 0.8);
+}
+
+.window-list-item-demands-attention {
+ background-color: #ff7b63;
+}
+
+.window-list-preview {
+ border: 1px solid #333333;
+ background-color: #242424;
+ border-radius: 8px;
+ padding: 12px;
+ spacing: 4px;
+ box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.5);
+}
\ No newline at end of file
#!/usr/bin/env perl
-use warnings; use strict;
+use warnings; use strict;
use Syntax::Keyword::Try;
use lib::relative ('.','../system/modules');
require TestManager;
my $test = TestManager -> new($0);
my $cnf;
-try{
+try{
###
# Test instance creation.
1,2,3
4,5 6
>>
-<<%A$$<%>
+<<%A$$<%>
hello = "world"
ask: How are you today?
>>
));
$test->case("Passed new instance CNFParser.",'1');
$test->subcase('CNFParser->VERSION is '.CNFParser->VERSION);
- #
+ #
$test-> nextCase();
#
$test->case("Test array.",'2');
my @array1 = $cnf -> property('@array1');
- $test->evaluate('Array has 4 elements?',scalar(@array1),4);
+ $test->evaluate('@array1 has 4 elements?',scalar(@array1),4);
+ $test->evaluate('@array1 contains "1 2 3 4"?',"@array1", "1 2 3 4");
+ $test->evaluate('@array1[0] is 1?',$array1[0], 1);
+
my @array2 = $cnf -> property('@array2');
- $test->evaluate('Array has 1 element?',scalar(@array2),1);
- $test->evaluate('Array[0] has value 1 2 3 4?',$array2[0],"1 2 3 4");
+ #change since v.3.3.7 string is split based on CNFMeta::DELIMITER.
+ $test->evaluate('@array2 has 4 elements?',scalar(@array2),4);
+ $test->evaluate('@array2[0] is 1?',$array2[0], 1);
+ $test->evaluate('pop @array2[last] is 4?',pop @array2, 4);
+ $test->evaluate('array2 is now joined "123"?',"@array2", "1 2 3");
+
my @A0 = $cnf -> property('@A0');
- $test->evaluate('Array has 6 elements?',scalar(@A0),6);
- #
+ $test->evaluate('Array has 6 elements?',scalar(@A0),6);
+ #
$test-> nextCase();
#
$test->case("Test as a hash property.",'3');
my %A1 = $cnf -> property('@A1');
- $test->evaluate('Hash has two keys?',scalar(keys %A1),2);
- $test->evaluate('hello eq "world"?',$A1{hello},'world');
- $test->evaluate('ask eq "How are you today?"?',$A1{ask},'How are you today?');
-
-
- #
- $test->done();
+ $test->evaluate('Hash has two keys?',scalar(keys %A1),2);
+ $test->evaluate('hello eq "world"?',$A1{hello},'world');
+ $test->evaluate('ask eq "How are you today?"?',$A1{ask},'How are you today?');
+
+
+ #
+ $test->done();
#
}
-catch{
- $test -> dumpTermination($@);
+catch{
+ $test -> dumpTermination($@);
$test -> doneFailed();
}