Debug new Template
parent
e1aedc9559
commit
51dc18faa9
|
@ -534,7 +534,7 @@ sub compile_code_fragment
|
||||||
my \$blk_${1}_count = ref($ref) && $ref =~ /ARRAY/so ? scalar \@{$ref} : $ref ? 1 : 0;
|
my \$blk_${1}_count = ref($ref) && $ref =~ /ARRAY/so ? scalar \@{$ref} : $ref ? 1 : 0;
|
||||||
${to}
|
${to}
|
||||||
for (my \$blk_${1}_i = $at; \$blk_${1}_i < \$blk_${1}_count; \$blk_${1}_i $by) {
|
for (my \$blk_${1}_i = $at; \$blk_${1}_i < \$blk_${1}_count; \$blk_${1}_i $by) {
|
||||||
my \$blk_${1}_vars = ref($ref) && $ref =~ /ARRAY/so ? $ref ->{\$blk_${1}_i} : $ref;
|
my \$blk_${1}_vars = ref($ref) && $ref =~ /ARRAY/so ? $ref ->[\$blk_${1}_i] : $ref;
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
elsif ($e =~ /^END(?:\s+([a-z_][a-z0-9_]*))?$/iso)
|
elsif ($e =~ /^END(?:\s+([a-z_][a-z0-9_]*))?$/iso)
|
||||||
|
@ -544,7 +544,7 @@ EOF
|
||||||
warn "$& without BEGIN, IF or SET";
|
warn "$& without BEGIN, IF or SET";
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
my $l = $self->{in}->{$#{$self->{in}}};
|
my $l = $self->{in}->[$#{$self->{in}}];
|
||||||
if ($1 && ($l->[0] ne 'begin' || !$l->[1] || $l->[1] ne $1) ||
|
if ($1 && ($l->[0] ne 'begin' || !$l->[1] || $l->[1] ne $1) ||
|
||||||
!$1 && $l->[1])
|
!$1 && $l->[1])
|
||||||
{
|
{
|
||||||
|
@ -615,7 +615,7 @@ sub compile_expression
|
||||||
$e =~ s/^\s+//so;
|
$e =~ s/^\s+//so;
|
||||||
$e =~ s/\s+$//so unless $after;
|
$e =~ s/\s+$//so unless $after;
|
||||||
# строковой или числовой литерал
|
# строковой или числовой литерал
|
||||||
if ($e =~ /^((\")(?:[^\"\\]+|\\.)+\"|\'(?:[^\'\\]+|\\.)+\'|[1-9]\d*(\.\d+)?|0\d*|0x\d+)\s*/iso)
|
if ($e =~ /^((\")(?:[^\"\\]+|\\.)*\"|\'(?:[^\'\\]+|\\.)*\'|[1-9]\d*(\.\d+)?|0\d*|0x\d+)\s*/iso)
|
||||||
{
|
{
|
||||||
if ($')
|
if ($')
|
||||||
{
|
{
|
||||||
|
@ -721,7 +721,8 @@ sub varref
|
||||||
my @e = ref $_[0] ? @{$_[0]} : split /\.+/, $_[0];
|
my @e = ref $_[0] ? @{$_[0]} : split /\.+/, $_[0];
|
||||||
$self->{last_varref_path} = join '.', @e;
|
$self->{last_varref_path} = join '.', @e;
|
||||||
my $t = '$self->{tpldata}';
|
my $t = '$self->{tpldata}';
|
||||||
EQBLOCK: if (@{$self->{blocks}})
|
EQBLOCK: {
|
||||||
|
if (@{$self->{blocks}})
|
||||||
{
|
{
|
||||||
for (0..$#{$self->{blocks}})
|
for (0..$#{$self->{blocks}})
|
||||||
{
|
{
|
||||||
|
@ -740,6 +741,7 @@ sub varref
|
||||||
$t = '$blk_'.$self->{blocks}->[$#{$self->{blocks}}].'_vars';
|
$t = '$blk_'.$self->{blocks}->[$#{$self->{blocks}}].'_vars';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (@e)
|
for (@e)
|
||||||
{
|
{
|
||||||
if (/^\d+$/so)
|
if (/^\d+$/so)
|
||||||
|
|
Loading…
Reference in New Issue