richter 00/12/18 12:41:49
Modified: . Tag: Embperl2c epcomp.c epdom.h epmain.c
Embperl Tag: Embperl2c Syntax.pm
test/html/EmbperlObject Tag: Embperl2c epobase.htm
Log:
Embperl 2 - fix bug with multiple Executes
Revision Changes Path
No revision
No revision
1.4.2.29 +19 -2 embperl/Attic/epcomp.c
Index: epcomp.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epcomp.c,v
retrieving revision 1.4.2.28
retrieving revision 1.4.2.29
diff -u -r1.4.2.28 -r1.4.2.29
--- epcomp.c 2000/12/18 12:43:23 1.4.2.28
+++ epcomp.c 2000/12/18 20:41:40 1.4.2.29
@@ -625,6 +625,7 @@
const char * p ;
const char * q ;
int valid = 1 ;
+ tNode xCurrNode = 0 ;
StringNew (ppCode, 512) ;
if (sPerlCode)
@@ -720,10 +721,19 @@
else if (*p == 'l')
{
char s [20] ;
- //int l = sprintf (s, "%u", pNode -> xNdx) ;
int l = sprintf (s, "%u", pDomTree -> xLastNode) ;
StringAdd (ppCode, s, l) ;
}
+ else if (*p == 'c')
+ {
+ char s [20] ;
+ if (pDomTree -> xLastNode != pDomTree -> xCurrNode)
+ {
+ int l = sprintf (s, "$_ep_node=%u;", pDomTree ->
xLastNode) ;
+ StringAdd (ppCode, s, l) ;
+ xCurrNode = pDomTree -> xLastNode ;
+ }
+ }
else if (*p == 'q')
{
char s [20] ;
@@ -742,7 +752,12 @@
}
}
if (valid)
+ {
StringAdd (ppCode, sPerlCode, 0) ;
+ if (xCurrNode)
+ pDomTree -> xCurrNode = xCurrNode ;
+ }
+
}
return valid ;
}
@@ -1244,6 +1259,8 @@
int bCheckpointPending = 0 ;
+ pDomTree -> xCurrNode = 0 ;
+
if ((rc = embperl_CompileNode (r, pDomTree, pDomTree -> xDocument,
&bCheckpointPending)) != ok)
return rc ;
@@ -1599,7 +1616,7 @@
pCallerDomTree = DomTree_self (r -> xCurrDomTree) ;
//xDocFraq = Node_replaceChildWithNode (pSubDomTree, pSubDomTree -> xDocument,
pCallerDomTree, r -> xCurrNode) ;
- xDocFraq = Node_insertAfter (pSubDomTree, pSubDomTree -> xDocument,
pCallerDomTree, r -> xCurrNode) ;
+ r -> xCurrNode = xDocFraq = Node_insertAfter (pSubDomTree, pSubDomTree ->
xDocument, pCallerDomTree, r -> xCurrNode) ;
/* Element_selfSetAttribut (pCallerDomTree, Node_self (pCallerDomTree,
xDocFraq), NULL, xOrderIndexAttr, NULL, nOrderNdx, 0) ; */
1.4.2.11 +1 -0 embperl/Attic/epdom.h
Index: epdom.h
===================================================================
RCS file: /home/cvs/embperl/Attic/epdom.h,v
retrieving revision 1.4.2.10
retrieving revision 1.4.2.11
diff -u -r1.4.2.10 -r1.4.2.11
--- epdom.h 2000/12/17 13:16:55 1.4.2.10
+++ epdom.h 2000/12/18 20:41:41 1.4.2.11
@@ -160,6 +160,7 @@
tIndex xNdx ; /* Index of Dom Tree */
tNode xDocument ; /* root document node */
tNode xLastNode ; /* last node that was compiled */
+ tNode xCurrNode ; /* curr node that is compiled */
tIndex xFilename ; /* name of source file */
SV * pSV ; /* general purpose SV */
SV * pDomTreeSV ; /* SV that's hold the Index */
1.75.4.20 +1 -1 embperl/epmain.c
Index: epmain.c
===================================================================
RCS file: /home/cvs/embperl/epmain.c,v
retrieving revision 1.75.4.19
retrieving revision 1.75.4.20
diff -u -r1.75.4.19 -r1.75.4.20
--- epmain.c 2000/12/18 12:43:24 1.75.4.19
+++ epmain.c 2000/12/18 20:41:41 1.75.4.20
@@ -2834,7 +2834,7 @@
{
tDomTree * pDomTree = DomTree_self (r -> xCurrDomTree) ;
//Node_replaceChildWithNode (pDomTree, pDomTree -> xDocument,
DomTree_self (l -> xCurrDomTree), l -> xCurrNode) ;
- Node_insertAfter (pDomTree, pDomTree -> xDocument,
DomTree_self (l -> xCurrDomTree), l -> xCurrNode) ;
+ l -> xCurrNode = Node_insertAfter (pDomTree, pDomTree ->
xDocument, DomTree_self (l -> xCurrDomTree), l -> xCurrNode) ;
}
}
#endif
No revision
No revision
1.1.4.11 +9 -5 embperl/Embperl/Attic/Syntax.pm
Index: Syntax.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Attic/Syntax.pm,v
retrieving revision 1.1.4.10
retrieving revision 1.1.4.11
diff -u -r1.1.4.10 -r1.1.4.11
--- Syntax.pm 2000/12/18 11:38:27 1.1.4.10
+++ Syntax.pm 2000/12/18 20:41:46 1.1.4.11
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Syntax.pm,v 1.1.4.10 2000/12/18 11:38:27 richter Exp $
+# $Id: Syntax.pm,v 1.1.4.11 2000/12/18 20:41:46 richter Exp $
#
###################################################################################
@@ -170,10 +170,14 @@
'procinfo' => {
embperl => {
perlcode => [
- '$_ep_node=%$l%;if (!defined
(scalar(do{%#~0:$col%}))) %#~-0:$row% { if ($col == 0) { _ep_dcp (%$t%,%^*htmltable%)
; last l%^*htmltable% ; } else { _ep_dcp (%$t%,%^*htmlrow%) ; last l%^*htmlrow% ; }}',
- '$_ep_node=%$l%;if (!defined
(scalar(do{%#~0:$col%}))) { _ep_dcp (%$t%,%^*htmlrow%) ; last l%^*htmlrow% ; }',
- '$_ep_node=%$l%;if (!defined
(scalar(do{%#~0:$row%}))) { _ep_dcp (%$t%,%^*htmltable%) ; last l%^*htmltable% ; }',
- '$_ep_node=%$l%;{%#0%;}',
+ #'$_ep_node=%$l%;if (!defined
(scalar(do{%#~0:$col%}))) %#~-0:$row% { if ($col == 0) { _ep_dcp (%$t%,%^*htmltable%)
; last l%^*htmltable% ; } else { _ep_dcp (%$t%,%^*htmlrow%) ; last l%^*htmlrow% ; }}',
+ #'$_ep_node=%$l%;if (!defined
(scalar(do{%#~0:$col%}))) { _ep_dcp (%$t%,%^*htmlrow%) ; last l%^*htmlrow% ; }',
+ #'$_ep_node=%$l%;if (!defined
(scalar(do{%#~0:$row%}))) { _ep_dcp (%$t%,%^*htmltable%) ; last l%^*htmltable% ; }',
+ #'$_ep_node=%$l%;{%#0%;}',
+ '%$c%if (!defined (scalar(do{%#~0:$col%})))
%#~-0:$row% { if ($col == 0) { _ep_dcp (%$t%,%^*htmltable%) ; last l%^*htmltable% ; }
else { _ep_dcp (%$t%,%^*htmlrow%) ; last l%^*htmlrow% ; }}',
+ '%$c%if (!defined (scalar(do{%#~0:$col%}))) {
_ep_dcp (%$t%,%^*htmlrow%) ; last l%^*htmlrow% ; }',
+ '%$c%if (!defined (scalar(do{%#~0:$row%}))) {
_ep_dcp (%$t%,%^*htmltable%) ; last l%^*htmltable% ; }',
+ '%$c%{%#0%;}',
],
removenode => 3,
#removenode => 10,
No revision
No revision
1.1.6.1 +3 -3 embperl/test/html/EmbperlObject/epobase.htm
Index: epobase.htm
===================================================================
RCS file: /home/cvs/embperl/test/html/EmbperlObject/epobase.htm,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -r1.1 -r1.1.6.1
--- epobase.htm 2000/04/17 21:03:19 1.1
+++ epobase.htm 2000/12/18 20:41:48 1.1.6.1
@@ -3,8 +3,8 @@
<title>Example</title>
</head>
<body>
- [- Execute ('epohead.htm') -]
- [- Execute ('*') -]
- [- Execute ('epofoot.htm') -]
+ [- Execute ('epohead.htm') ;
+ Execute ('*') ;
+ Execute ('epofoot.htm') -]
</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]