You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@locus.apache.org on 2000/06/19 06:15:33 UTC
cvs commit: embperl/test/cmp unclosed.htm
richter 00/06/18 21:15:32
Modified: . Tag: Embperl2 epcomp.c epparse.c test.pl
Embperl Tag: Embperl2 Syntax.pm
test/cmp Tag: Embperl2 unclosed.htm
Log:
Embperl 2 - tag mismatch error msg
Revision Changes Path
No revision
No revision
1.1.2.35 +23 -18 embperl/Attic/epcomp.c
Index: epcomp.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epcomp.c,v
retrieving revision 1.1.2.34
retrieving revision 1.1.2.35
diff -u -r1.1.2.34 -r1.1.2.35
--- epcomp.c 2000/06/18 19:27:53 1.1.2.34
+++ epcomp.c 2000/06/19 04:15:25 1.1.2.35
@@ -374,7 +374,7 @@
if (strcmp (s, sStackValue) == 0)
return ok ;
- strncpy (pCurrReq -> errdat1, Ndx2String (pNode -> nText), sizeof (pCurrReq -> errdat1)) ;
+ strncpy (pCurrReq -> errdat1, Node_selfNodeName (pNode), sizeof (pCurrReq -> errdat1)) ;
sprintf (pCurrReq -> errdat2, "'%s', starttag should be '%s'", s, sStackValue) ;
pCurrReq -> Buf.pCurrPos = NULL ;
pCurrReq -> Buf.nSourceline = pNode -> nLinenumber ;
@@ -686,6 +686,7 @@
{
+ int rc ;
tNode xChildNode ;
tStringIndex nNdx ;
tEmbperlCmd * pCmd ;
@@ -871,13 +872,20 @@
}
- if (pCmd -> sStackName && pCmd -> sPushStack)
- {
- if (embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sPushStack, &sStackValue))
- {
- embperl_CompilePushStack (pDomTree, pCmd -> sStackName, sStackValue) ;
+ if (pCmd -> sStackName)
+ {
+ if (pCmd -> sMatchStack && pNode -> nType != ntypStartTag && pNode -> nType != ntypDocument)
+ {
+ if (embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sMatchStack, &sStackValue))
+ if ((rc = embperl_CompileMatchStack (pDomTree, pNode, pCmd -> sStackName, sStackValue)) != ok)
+ return rc ;
}
- }
+ if (pCmd -> sPushStack)
+ {
+ if (embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sPushStack, &sStackValue))
+ embperl_CompilePushStack (pDomTree, pCmd -> sStackName, sStackValue) ;
+ }
+ }
if (pCmd -> sStackName2 && pCmd -> sPushStack2)
{
if (embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sPushStack2, &sStackValue))
@@ -895,7 +903,8 @@
while (xChildNode)
{
- embperl_CompileNode (pDomTree, xChildNode, bCheckpointPending) ;
+ if ((rc = embperl_CompileNode (pDomTree, xChildNode, bCheckpointPending)) != ok)
+ return rc ;
xChildNode = Node_nextSibling (pDomTree, xChildNode) ;
}
@@ -933,29 +942,22 @@
if (pCurrReq -> bDebug & dbgParse)
lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Set Checkpoint pending\n", pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
}
- if (pCmd -> sStackName)
+ if (pCmd -> sStackName && (pNode -> nType == ntypStartTag || pNode -> nType == ntypDocument))
{
if (pCmd -> sMatchStack)
{
if (embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sMatchStack, &sStackValue))
{
- int rc ;
-
if ((rc = embperl_CompileMatchStack (pDomTree, pNode, pCmd -> sStackName, sStackValue)) != ok)
return rc ;
}
}
- }
- else
- {
- if (pCmd -> sPushStack && pNode -> nType == ntypStartTag)
+ else if (pCmd -> sPushStack)
embperl_CompilePopStack (pDomTree, pCmd -> sStackName) ;
}
if (pCmd -> sStackName2 && pCmd -> sPushStack2)
- {
embperl_CompilePopStack (pDomTree, pCmd -> sStackName2) ;
- }
}
StringFree (&sStackValue) ;
@@ -1016,7 +1018,6 @@
lprintf (r, "IV ppSV=%s type=%d\n", *ppSV?"ok":"NULL", *ppSV?SvTYPE (*ppSV):-1) ;
pDomTree = DomTree_self (r -> xCurrDomTree) ;
- xNode = Node_firstChild (pDomTree, r -> xDocument) ;
StringNew (&pProg, r -> Buf.pFile -> nFilesize / 4) ;
StringAdd (&pProg, "my $_ep_DomTree = $_[1];\nmy $_ep_EscMask = 5;\n*_ep_rp=\\&XML::Embperl::DOM::Node_replaceChildWithCDATA;\n*_ep_rpurl=\\&XML::Embperl::DOM::Node_replaceChildWithUrlDATA;\n*_ep_cp=\\&XML::Embperl::DOM::DomTree_checkpoint;\n ", 0) ;
@@ -1025,6 +1026,7 @@
pDomTree -> pSV = (SV *)newHV () ;
nLabelCnt = 1 ;
+ /* xNode = Node_firstChild (pDomTree, r -> xDocument) ;
while (xNode)
{
if ((rc = embperl_CompileNode (pDomTree, xNode, &bCheckpointPending)) != ok)
@@ -1032,6 +1034,9 @@
xNode = Node_nextSibling (pDomTree, xNode) ;
}
+ */
+ if ((rc = embperl_CompileNode (pDomTree, r -> xDocument, &bCheckpointPending)) != ok)
+ return rc ;
SvREFCNT_dec (pDomTree -> pSV) ;
pDomTree -> pSV = NULL ;
1.1.2.27 +1 -1 embperl/Attic/epparse.c
Index: epparse.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epparse.c,v
retrieving revision 1.1.2.26
retrieving revision 1.1.2.27
diff -u -r1.1.2.26 -r1.1.2.27
--- epparse.c 2000/06/18 19:27:54 1.1.2.26
+++ epparse.c 2000/06/19 04:15:25 1.1.2.27
@@ -723,7 +723,7 @@
if (!(xDocNode = Node_appendChild (pDomTree, ntypTag, 0, "attr", 3, 0, 0, 0)))
return 1 ;
- if (!(xDocNode = Node_appendChild (pDomTree, r -> bSubReq?ntypDocumentFraq:ntypDocument, 0, "doc", 3, 0, 0, 0)))
+ if (!(xDocNode = Node_appendChild (pDomTree, r -> bSubReq?ntypDocumentFraq:ntypDocument, 0, "Document", 8, 0, 0, 0)))
return 1 ;
if (!(xNode = Node_appendChild (pDomTree, ntypAttr, 0, NULL, xDomTreeAttr, xDocNode, 0, 0)))
1.57.2.28 +1 -1 embperl/test.pl
Index: test.pl
===================================================================
RCS file: /home/cvs/embperl/test.pl,v
retrieving revision 1.57.2.27
retrieving revision 1.57.2.28
diff -u -r1.57.2.27 -r1.57.2.28
--- test.pl 2000/06/18 19:27:54 1.57.2.27
+++ test.pl 2000/06/19 04:15:25 1.57.2.28
@@ -21,7 +21,7 @@
'error.htm???7',
'errormismatch.htm???1',
'errormismatchcmd.htm???1',
-## 'unclosed.htm???1',
+ 'unclosed.htm???1',
# 'errorright.htm???1',
'notfound.htm???1',
'notallow.xhtm???1',
No revision
No revision
1.1.2.27 +25 -1 embperl/Embperl/Attic/Syntax.pm
Index: Syntax.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Attic/Syntax.pm,v
retrieving revision 1.1.2.26
retrieving revision 1.1.2.27
diff -u -r1.1.2.26 -r1.1.2.27
--- Syntax.pm 2000/06/18 19:27:55 1.1.2.26
+++ Syntax.pm 2000/06/19 04:15:28 1.1.2.27
@@ -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.2.26 2000/06/18 19:27:55 richter Exp $
+# $Id: Syntax.pm,v 1.1.2.27 2000/06/19 04:15:28 richter Exp $
#
###################################################################################
@@ -26,6 +26,14 @@
use constant ntypAttrValue => 2 + 0x20 ;
use constant ntypText => 3 ;
use constant ntypCDATA => 4 ;
+use constant ntypEntityRef => 5 ;
+use constant ntypEntity => 6 ;
+use constant ntypProcessingInstr => 7 ;
+use constant ntypComment => 8 ;
+use constant ntypDocument => 9 ;
+use constant ntypDocumentType => 10 ;
+use constant ntypDocumentFraq => 11 ;
+use constant ntypNotation => 12 ;
sub clonehash
@@ -725,6 +733,21 @@
%Default = (
'-lsearch' => 1,
+
+ # The document node is generated always and is not parserd, but can be used to include code
+ 'Document' => {
+ 'nodename' => 'Document',
+ 'nodetype' => ntypDocument,
+ 'procinfo' => {
+ embperl => {
+ perlcode => '# Include here any setup code',
+ perlcodeend => '# Include here any cleanup code',
+ stackname => 'metacmd',
+ stackmatch => 'Document',
+ 'push' => 'Document',
+ }
+ },
+ },
'HTML Tag' => {
'text' => '<',
'end' => '>',
@@ -735,6 +758,7 @@
'end' => '-->',
},
%Cmds,
+
) ;
No revision
No revision
1.2.2.1 +1 -1 embperl/test/cmp/unclosed.htm
Index: unclosed.htm
===================================================================
RCS file: /home/cvs/embperl/test/cmp/unclosed.htm,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- unclosed.htm 1999/10/05 06:02:21 1.2
+++ unclosed.htm 2000/06/19 04:15:31 1.2.2.1
@@ -2,6 +2,6 @@
<H1>Internal Server Error</H1>
The server encountered an internal error or misconfiguration and was unable to complete your request.<P>
^Please contact the server administrator\,.*?and inform them of the time the error occurred\, and anything you might have done that may have caused the error
-^\[.*?\]ERR\: 46\: Line 12\: Unclosed command \[\$ if \$\] at end of file
+^\[.*?\]ERR\: 49\: Line 0: Endtag 'Document' doesn't match starttag ''if', starttag should be 'Document''<p>
^ HTML\:\:Embperl.*?<P>
</BODY></HTML>