richter 00/08/20 21:22:50
Modified: . Changes.pod Embperl.pm MANIFEST epcmd.c test.pl
test/cmp loop.htm
Added: test/cmp epodiv.htm
test/html/EmbperlObject epodiv.htm
Log:
- Fixed a problem with importing files that contains foreach and
do until loops, which may caused a syntax error or endless
loop. Spotted by Steffen Geschke.
Revision Changes Path
1.125 +11 -1 embperl/Changes.pod
Index: Changes.pod
===================================================================
RCS file: /home/cvs/embperl/Changes.pod,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -r1.124 -r1.125
--- Changes.pod 2000/08/20 18:56:51 1.124
+++ Changes.pod 2000/08/21 04:22:47 1.125
@@ -1,6 +1,16 @@
=pod
-=head1 1.3b5 /BETA) 20. Aug 2000
+=head1 1.3b6_dev -- That's what currently under developement
+
+Last Update: <$localtime$> (MET)
+
+NOTE: This version is only available via L<"CVS"|CVS/"INTRO">
+
+ - Fixed a problem with importing files that contains foreach and
+ do until loops, which may caused a syntax error or endless
+ loop. Spotted by Steffen Geschke.
+
+=head1 1.3b5 (BETA) 20. Aug 2000
- Embperl now supports Apache::Session 1.52. See "Session handling"
in the docs, how the setup has changed.
1.113 +1 -1 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- Embperl.pm 2000/08/20 18:56:52 1.112
+++ Embperl.pm 2000/08/21 04:22:47 1.113
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Embperl.pm,v 1.112 2000/08/20 18:56:52 richter Exp $
+# $Id: Embperl.pm,v 1.113 2000/08/21 04:22:47 richter Exp $
#
###################################################################################
@@ -80,7 +80,7 @@
@ISA = qw(Exporter DynaLoader);
-$VERSION = '1.3b5';
+$VERSION = '1.3b6_dev';
# HTML::Embperl cannot be bootstrapped in nonlazy mode except
1.46 +2 -0 embperl/MANIFEST
Index: MANIFEST
===================================================================
RCS file: /home/cvs/embperl/MANIFEST,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- MANIFEST 2000/07/17 05:16:07 1.45
+++ MANIFEST 2000/08/21 04:22:48 1.46
@@ -135,6 +135,7 @@
test/html/EmbperlObject/epohead.htm
test/html/EmbperlObject/epofoot.htm
test/html/EmbperlObject/epopage1.htm
+test/html/EmbperlObject/epodiv.htm
test/html/EmbperlObject/sub/epohead.htm
test/html/EmbperlObject/sub/epopage2.htm
test/html/EmbperlObject/epofallback.htm
@@ -213,6 +214,7 @@
test/cmp/errdoc.htm
test/cmp/clearsess.htm
test/cmp/epopage1.htm
+test/cmp/epodiv.htm
test/cmp/epopage2.htm
test/cmp/epoobj1.htm
test/cmp/epoobj2.htm
1.36 +5 -2 embperl/epcmd.c
Index: epcmd.c
===================================================================
RCS file: /home/cvs/embperl/epcmd.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- epcmd.c 2000/08/20 17:50:13 1.35
+++ epcmd.c 2000/08/21 04:22:48 1.36
@@ -544,7 +544,7 @@
rc = EvalBool (r, (char *)sArg, (r -> CmdStack.State.pStart - r -> Buf.pBuf),
&r -> CmdStack.State.nResult) ;
- if (!r -> CmdStack.State.nResult && rc == ok)
+ if (!r -> CmdStack.State.nResult && rc == ok && !r -> pImportStash)
{
r -> Buf.pCurrPos = r -> CmdStack.State.pStart ;
r -> Buf.nBlockNo = r -> CmdStack.State.nBlockNo ;
@@ -622,7 +622,10 @@
if ((rc = EvalTransFlags (r, sVarName, (r -> CmdStack.State.pStart - r ->
Buf.pBuf), G_ARRAY, &pRV)) != ok)
return rc ;
- if (pRV == NULL)
+ if (r -> pImportStash)
+ return ok ;
+
+ if (pRV == NULL)
return rcMissingArgs ;
if (SvTYPE (pRV) != SVt_RV)
1.66 +1 -0 embperl/test.pl
Index: test.pl
===================================================================
RCS file: /home/cvs/embperl/test.pl,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- test.pl 2000/08/20 17:50:13 1.65
+++ test.pl 2000/08/21 04:22:48 1.66
@@ -95,6 +95,7 @@
'execgetsess.htm',
'clearsess.htm',
'EmbperlObject/epopage1.htm',
+ 'EmbperlObject/epodiv.htm',
'EmbperlObject/sub/epopage2.htm',
'EmbperlObject/sub/epopage2.htm',
'EmbperlObject/sub/eponotfound.htm',
1.9 +1 -1 embperl/test/cmp/loop.htm
Index: loop.htm
===================================================================
RCS file: /home/cvs/embperl/test/cmp/loop.htm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- loop.htm 2000/08/20 18:56:54 1.8
+++ loop.htm 2000/08/21 04:22:49 1.9
@@ -228,4 +228,4 @@
</body>
</html>
-
+
1.1 embperl/test/cmp/epodiv.htm
Index: epodiv.htm
===================================================================
<html>
<head>
<title>Example</title>
</head>
<body>
<h1>head from foo</h1>
<html>
<head>
<title>Some Plain tests Embperl</title>
</head>
<body>
Here it starts with some HTML Text<P>
All values should be undefined:
$a = <BR>
$b = <BR>
$c = <BR>
$d = <BR>
$e = <BR>
First of all assign a value:
<BR>
Now we have some 'Umlaute':
Now lets look what we are getting from this:<BR>
(this is the value in $a) (this is the value in $a) äöü<BR>
And now a and b together: (this is the value in $a)(this is the value in $a)
äöü<P>
Here we have some HTML tags within the perl code, Embperl will delete them!<BR>
57
Embperl will also translate HMTL escapes to the right characters i.e. $a &lt; 6
will get the perl expression $a < 6: <BR>
1
Now they should have a value
$a = (this is the value in $a) <BR>
$b = (this is the value in $a) äöü <BR>
$c = 57 <BR>
$d = 1 <BR>
$e = 2 <BR>
a <br>
a <br>
a <br>
b is null <br>
a <br>
b is null <br>
a<br>
b is null <br>
<table></table>
<p> $tabmode = default <p>
<hr><p>Display an two dimensional array with one, two and three columns !<BR>
Please take a look at the source in your browser to see the difference<BR>
$a[0][0] = '1/1' ;<BR>
$a[1][0] = '2/1' ;<BR>
$a[1][1] = '2/2' ;<BR>
$a[2][0] = '3/1' ;<BR>
$a[2][1] = '3/2' ;<BR>
$a[2][2] = '3/3' ;<BR>
<P>$tabmode = default <P>
<table border="2" width="100%">
<tr>
<td>a1/1 </td>
</tr>
<tr>
<td>a2/1 </td>
<td>a2/2 </td>
</tr>
<tr>
<td>a3/1 </td>
<td>a3/2 </td>
<td>a3/3 </td>
</tr>
</table>
<table border="2" width="100%">
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
<tr>
<td>a1/1 </td>
</tr>
<tr>
<td>a2/1 </td>
<td>a2/2 </td>
</tr>
<tr>
<td>a3/1 </td>
<td>a3/2 </td>
<td>a3/3 </td>
</tr>
</table>
<table border="2" width="100%">
<tr>
<th>b3/1</th>
<th>b3/2</th>
<th>b3/3</th>
</tr>
<tr>
<td>a1/1 </td>
</tr>
<tr>
<td>a2/1 </td>
<td>a2/2 </td>
</tr>
<tr>
<td>a3/1 </td>
<td>a3/2 </td>
<td>a3/3 </td>
</tr>
</table>
<table>
<tr>
<td>
<table>
<tr>
<td>b1/1 </td>
</tr>
<tr>
<td>b2/1 </td>
<td>b2/2 </td>
</tr>
<tr>
<td>b3/1 </td>
<td>b3/2 </td>
<td>b3/3 </td>
</tr>
</table>
a1/1 </td>
</tr>
<tr>
<td>
<table>
<tr>
<td>b1/1 </td>
</tr>
<tr>
<td>b2/1 </td>
<td>b2/2 </td>
</tr>
<tr>
<td>b3/1 </td>
<td>b3/2 </td>
<td>b3/3 </td>
</tr>
</table>
a2/1 </td>
<td>
<table>
<tr>
<td>b1/1 </td>
</tr>
<tr>
<td>b2/1 </td>
<td>b2/2 </td>
</tr>
<tr>
<td>b3/1 </td>
<td>b3/2 </td>
<td>b3/3 </td>
</tr>
</table>
a2/2 </td>
</tr>
<tr>
<td>
<table>
<tr>
<td>b1/1 </td>
</tr>
<tr>
<td>b2/1 </td>
<td>b2/2 </td>
</tr>
<tr>
<td>b3/1 </td>
<td>b3/2 </td>
<td>b3/3 </td>
</tr>
</table>
a3/1 </td>
<td>
<table>
<tr>
<td>b1/1 </td>
</tr>
<tr>
<td>b2/1 </td>
<td>b2/2 </td>
</tr>
<tr>
<td>b3/1 </td>
<td>b3/2 </td>
<td>b3/3 </td>
</tr>
</table>
a3/2 </td>
<td>
<table>
<tr>
<td>b1/1 </td>
</tr>
<tr>
<td>b2/1 </td>
<td>b2/2 </td>
</tr>
<tr>
<td>b3/1 </td>
<td>b3/2 </td>
<td>b3/3 </td>
</tr>
</table>
a3/3 </td>
</tr>
</table>
^<P>1\.3.*?<P>
<P>17<P>
<P>1<P>
<P>
0
1
2
A = 1<br>
B = 2<br>
C = 3<br>
@a[0] = a<br>
@a[1] = b<br>
@a[2] = c<br>
@a[3] = d<br>
@a[0] = a<br>
@a[1] = b<br>
@a[2] = c<br>
@a[3] = d<br>
a <br>
b <br>
c <br>
d <br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
1 <br>
2 <br>
3 <br>
4 <br>
5 <br>
6 <br>
7 <br>
8 <br>
9 <br>
10 <br>
2:1 <br>
2:2 <br>
2:3 <br>
2:4 <br>
2:5 <br>
3:a <br>
3:b <br>
3:c <br>
@a[0] = a<br>
A = 1<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
B = 2<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
C = 3<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
@a[1] = b<br>
A = 1<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
B = 2<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
C = 3<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
@a[2] = c<br>
A = 1<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
B = 2<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
C = 3<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
@a[3] = d<br>
A = 1<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
B = 2<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
C = 3<br>
1 <br>
3 <br>
5 <br>
7 <br>
9 <br>
x
y
<table>
<tr>
<td>ii[0] = 0 </td>
</tr>
<tr>
<td>ii[1] = 1 </td>
</tr>
<tr>
<td>ii[2] = 2 </td>
</tr>
<tr>
<td>ii[3] = 3 </td>
</tr>
<tr>
<td>ii[4] = 4 </td>
</tr>
<tr>
<td>ii[5] = 5 </td>
</tr>
<tr>
<td>ii[6] = 6 </td>
</tr>
<tr>
<td>ii[7] = 7 </td>
</tr>
<tr>
<td>ii[8] = 8 </td>
</tr>
<tr>
<td>ii[9] = 9 </td>
</tr>
</table>
</body>
</html>
<hr> Footer <hr>
</body>
</html>
1.1 embperl/test/html/EmbperlObject/epodiv.htm
Index: epodiv.htm
===================================================================
<html>
<head>
<title>Some Plain tests Embperl</title>
</head>
<body>
[$ var $a $b $c $d $e $i $ii $v $k $fv @a @b %h @c @ii %hash $]
Here it starts with some HTML Text<P>
All values should be undefined:
$a = [+ $a || '' +] <BR>
$b = [+ $b || '' +] <BR>
$c = [+ $c || '' +] <BR>
$d = [+ $d || '' +] <BR>
$e = [+ $e || '' +] <BR>
First of all assign a value:
[- $a = '(this is the value in $a)' -] <BR>
Now we have some 'Umlaute':
[- $b = "$a äöü" -]
Now lets look what we are getting from this:<BR>
[+ $a +] [+ $b +]<BR>
And now a and b together: [+ "$a$b" +]<P>
Here we have some HTML tags within the perl code, Embperl will delete them!<BR>
[+ $c = <BR> 6 + 17 <font size="3"> * 3 +]
Embperl will also translate HMTL escapes to the right characters i.e. $a &lt; 6
will get the perl expression $a < 6: <BR>
[- $e = 2 -]
[+ $d = $e < 6 +]
Now they should have a value
$a = [+ $a +] <BR>
$b = [+ $b +] <BR>
$c = [+ $c +] <BR>
$d = [+ $d +] <BR>
$e = [+ $e +] <BR>
[- $a = 1; $b = 0; $c = 5; $d = 'txt' -]
[$if $a$]
a <br>
[$ endif$]
[$if $a $]
a <br>
[$else$]
not a<br>
[$ endif $]
[$ if $a$]
a <br>
[$if $b == 0$]
b is null <br>
[$else$]
b is not null <br>
[$endif$]
[$ else$]
not a<br>
[$ endif $]
[$ if $a$]
a <br>
[$if $b == 0$]
b is null <br>
[$else$]
b is not null <br>
[$endif$]
[$ else$]
not a<br>
[$if $b == 0$]
b is null <br>
[$else$]
b is not null <br>
[$endif$]
[$ endif $]
[$ if !$a$]
not a <br>
[$if $b == 0$]
b is null <br>
[$else$]
b is not null <br>
[$endif$]
[$ else$]
a<br>
[$if $b == 0$]
b is null <br>
[$else$]
b is not null <br>
[$endif$]
[$ endif $]
[- $i = 0 -]
[$ while $i <= $#ffld $]
[+ $ffld[$i] +] = [+ $fdat{$ffld[$i]} +]
[- $j = 0 -]
[$ while $j <= $i $]
[+ $j++ +]
[$ endwhile $]
<BR>
[- $i++ -]
[$ endwhile $]
<table>
<tr>
<td>[+ $c[$row][$col] +] </td>
</tr>
</table>
<p> $tabmode = default <p>
<hr><p>Display an two dimensional array with one, two and three columns !<BR>
Please take a look at the source in your browser to see the difference<BR>
[-
undef @a ;
undef @b ;
$a[0][0] = 'a1/1' ;
$a[1][0] = 'a2/1' ;
$a[1][1] = 'a2/2' ;
$a[2][0] = 'a3/1' ;
$a[2][1] = 'a3/2' ;
$a[2][2] = 'a3/3' ;
$b[0][0] = 'b1/1' ;
$b[1][0] = 'b2/1' ;
$b[1][1] = 'b2/2' ;
$b[2][0] = 'b3/1' ;
$b[2][1] = 'b3/2' ;
$b[2][2] = 'b3/3' ;
$maxcol=99 ;
-]
$a[0][[0] = '1/1' ;<BR>
$a[1][[0] = '2/1' ;<BR>
$a[1][[1] = '2/2' ;<BR>
$a[2][[0] = '3/1' ;<BR>
$a[2][[1] = '3/2' ;<BR>
$a[2][[2] = '3/3' ;<BR>
<P>$tabmode = default <P>
<table border="2" width="100%">
<tr>
<td>[+ $a[$row][$col] +] </td>
</tr>
</table>
<table border="2" width="100%">
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
</tr>
<tr>
<td>[+ $a[$row][$col] +] </td>
</tr>
</table>
<table border="2" width="100%">
<tr>
<th>[+ $b[2][$col] +]</th>
</tr>
<tr>
<td>[+ $a[$row][$col] +] </td>
</tr>
</table>
<table>
<tr>
<td>
<table>
<tr>
<td>[+ $b[$row][$col] +] </td>
</tr>
</table>
[+ $a[$row][$col] +] </td>
</tr>
</table>
<P>[+ $HTML::Embperl::VERSION +]<P>
<P>[+ $tabmode +]<P>
<P>[+ local $tabmode = 1 +]<P>
<P>
[- $i = 0 ; while ($i < 10) { $ii[$i++] = "ii[$i] = $i" ; } -]
[- $i = 0 -]
[$ while $i <= $#ffld $]
[+ $ffld[$i] +] = [+ $fdat{$ffld[$i]} +]
[- $j = 0 -]
[$ while $j <= $i $]
[+ $j++ +]
[$ endwhile $]
<BR>
[- $i++ -]
[$ endwhile $]
[- $i = 0 -]
[$ while($i <= 2)$]
[+ $i++ +]
[$ endwhile $]
[- %h = ('A' => 1, 'B' => 2, 'C' => 3) ; -]
[- @a = ('a', 'b', 'c', 'd') ; -]
[$ while ($v, $k) = each (%h) $]
[+ "$v = $k" +]<br>
[$ endwhile $]
[- $i = 0 -]
[$ while $i <= $#a $]
[+ "\@a[$i] = $a[$i]" +]<br>
[- $i++ -]
[$ endwhile $]
[- $i = 0 -]
[$ do $]
[+ "\@a[$i] = $a[$i]" +]<br>
[- $i++ -]
[$ until $i > $#a $]
[$ foreach $v @a $]
[+ $v +] <br>
[$ endforeach $]
[$ foreach $v (1, 3, 5, 7, 9) $]
[+ $v +] <br>
[$ endforeach $]
[$ foreach $v (1..10) $]
[+ $v +] <br>
[$ endforeach $]
[$ foreach $v(1..5) $]
2:[+ $v +] <br>
[$ endforeach $]
[- %hash = ( a=>1, b=>2, c=>3) -]
[$ foreach $v(keys %hash) $]
3:[+ $v +] <br>
[$ endforeach $]
[- $i = 0 -]
[$ do $]
[+ "\@a[$i] = $a[$i]" +]<br>
[$ while ($v, $k) = each (%h) $]
[+ "$v = $k" +]<br>
[$ foreach $fv (1, 3, 5, 7, 9) $]
[+ $fv +] <br>
[$ endforeach $]
[$ foreach $fv () $]
[+ $fv +] <br>
[$ while ($wv, $wk) = each (%h) $]
[+ "$wv = $wk" +]<br>
[$ endwhile $]
[$ endforeach $]
[$ endwhile $]
[- $i++ -]
[$ until $i > $#a $]
[- undef @a ; undef @b -]
[$ if 1 $]
x
[$ foreach $a (@a) $]
[$ foreach $b (@b) $]
[$ endforeach $]
[$ endforeach $]
y
[$ endif $]
<table>
<tr>
<td>[+ $ii[$row] +] </td>
</tr>
</table>
</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]