version 1.53, 2005/11/08 18:59:03
|
version 1.58, 2006/03/16 15:47:37
|
Line 50 while (!$_LONCAPA_INTERNAL_oldexpression
|
Line 50 while (!$_LONCAPA_INTERNAL_oldexpression
|
my $__LC__prefix; |
my $__LC__prefix; |
my $__LC__result; |
my $__LC__result; |
while (1) { |
while (1) { |
|
if ($__LC__a =~ m-^&(theta|pi|rho)$-) { last; } |
{ |
{ |
use strict; |
use strict; |
no strict "vars"; |
no strict "vars"; |
Line 77 sub evaluate {
|
Line 78 sub evaluate {
|
my $result = ''; |
my $result = ''; |
$@=''; |
$@=''; |
$Apache::run::timeout=0; |
$Apache::run::timeout=0; |
$main::SIG{'ALRM'} = sub { |
local $main::SIG{'ALRM'} = sub { |
$Apache::run::timeout=1; |
$Apache::run::timeout=1; |
die("timeout"); |
die("timeout"); |
}; |
}; |
Line 115 sub run {
|
Line 116 sub run {
|
my @result; |
my @result; |
$@=''; |
$@=''; |
$Apache::run::timeout=0; |
$Apache::run::timeout=0; |
$main::SIG{'ALRM'} = sub { |
local $main::SIG{'ALRM'} = sub { |
$Apache::run::timeout=1; |
$Apache::run::timeout=1; |
die("timeout"); |
die("timeout"); |
}; |
}; |
Line 139 sub run {
|
Line 140 sub run {
|
if ($innererror=~/line (\d+)/) { |
if ($innererror=~/line (\d+)/) { |
my $linenumber=$1; |
my $linenumber=$1; |
my @code=split("\n",$code); |
my @code=split("\n",$code); |
$code[$linenumber-1]='<b><font color="red">'. |
if ($linenumber < scalar(@code)) { |
$code[$linenumber-1].'</font></b>'; |
$code[$linenumber-1]='<b><font color="red">'. |
|
$code[$linenumber-1].'</font></b>'; |
|
} |
$code=join("\n",@code); |
$code=join("\n",@code); |
} |
} |
&Apache::lonxml::error($errormsg.$code.'</pre>'); |
&Apache::lonxml::error($errormsg.$code.'</pre>'); |
Line 157 sub dump {
|
Line 160 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!~/\027/) && ($symname!~/^\_/) && ($symname!~/\:$/)) { |
if (($symname!~ /^(INC|SIG)/) && ($symname!~/\027/) && |
|
($symname!~/^\_/) && ($symname!~/\:$/)) { |
my $line; |
my $line; |
if ($safeeval->reval('defined($'.$symname.')')) { |
if ($safeeval->reval('defined($'.$symname.')')) { |
if ($symname =~ /^\w/) { |
if ($symname =~ /^\w/) { |