version 1.62, 2013/12/04 15:57:15
|
version 1.66, 2020/03/12 20:20:13
|
Line 41 while (!$_LONCAPA_INTERNAL_oldexpression
|
Line 41 while (!$_LONCAPA_INTERNAL_oldexpression
|
# or hash dereferences {} |
# or hash dereferences {} |
# the ^$ and ^& is because we do this iteratively |
# the ^$ and ^& is because we do this iteratively |
# $a[$c] becomes $a[3] which then evaluates |
# $a[$c] becomes $a[3] which then evaluates |
([\[\{][^\$\&\]\}]+[\]\}])*? |
((?:[\[\{][^\$\&\]\}]+[\]\}])+|) |
# $3 is the list of arguments |
# $3 is the list of arguments |
(\([^\$\&\)]+\))*? |
(\([^\$\&\)]+\))*? |
# only match the above if there is not { [ ( coming up |
# only match the above if there is not { [ ( coming up |
Line 163 sub run {
|
Line 163 sub run {
|
sub dump { |
sub dump { |
my ($target,$safeeval)=@_; |
my ($target,$safeeval)=@_; |
my $dump=''; |
my $dump=''; |
foreach my $symname (sort keys %{$safeeval->varglob('main::')}) { |
foreach my $symname (sort(keys(%{$safeeval->varglob('main::')}))) { |
if (($symname!~ /^(INC|SIG)/) && ($symname!~/\027/) && |
if (($symname!~ /^(INC|SIG)/) && ($symname!~/\027/) && ($symname!~/\022/) && |
($symname!~/^\_/) && ($symname!~/\:$/)) { |
($symname!~/^\_/) && ($symname!~/\:$/) && ($symname ne '!')) { |
my $line; |
my $line; |
if ($safeeval->reval('defined($'.$symname.')')) { |
if ($safeeval->reval('defined($'.$symname.')')) { |
if ($symname =~ /^\w/) { |
if ($symname =~ /^\w/) { |
Line 179 sub dump {
|
Line 179 sub dump {
|
if ($safeeval->reval('%'.$symname)) { |
if ($safeeval->reval('%'.$symname)) { |
$line.='%'.$symname.'=('; |
$line.='%'.$symname.'=('; |
$line.=$safeeval->reval('join(",",map { $_."=>".$'. |
$line.=$safeeval->reval('join(",",map { $_."=>".$'. |
$symname.'{$_} } sort keys %'. |
$symname.'{$_} } sort(keys(%'. |
$symname.')').")"."\n"; |
$symname.')))').")"."\n"; |
} |
} |
if ($line ne '') { |
if ($line ne '') { |
$line=&HTML::Entities::encode($line,'<>&"'); |
$line=&HTML::Entities::encode($line,'<>&"'); |