richter 01/07/24 21:03:13
Modified: . Tag: Embperl2c Embperl.pm epdom.h epparse.c
Embperl Tag: Embperl2c Syntax.pm
Log:
Start for POD parser
Revision Changes Path
No revision
No revision
1.118.4.48 +2 -2 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.118.4.47
retrieving revision 1.118.4.48
diff -u -r1.118.4.47 -r1.118.4.48
--- Embperl.pm 2001/07/09 12:53:28 1.118.4.47
+++ Embperl.pm 2001/07/25 04:03:12 1.118.4.48
@@ -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.118.4.47 2001/07/09 12:53:28 richter Exp $
+# $Id: Embperl.pm,v 1.118.4.48 2001/07/25 04:03:12 richter Exp $
#
###################################################################################
@@ -68,7 +68,7 @@
##ep2##
-$VERSION = '2.0b3' ;
+$VERSION = '2.0b4_dev' ;
##/ep2##
##ep1##$VERSION = '1.3.4_dev';
1.4.2.20 +2 -1 embperl/Attic/epdom.h
Index: epdom.h
===================================================================
RCS file: /home/cvs/embperl/Attic/epdom.h,v
retrieving revision 1.4.2.19
retrieving revision 1.4.2.20
diff -u -r1.4.2.19 -r1.4.2.20
--- epdom.h 2001/06/25 03:30:04 1.4.2.19
+++ epdom.h 2001/07/25 04:03:12 1.4.2.20
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epdom.h,v 1.4.2.19 2001/06/25 03:30:04 richter Exp $
+# $Id: epdom.h,v 1.4.2.20 2001/07/25 04:03:12 richter Exp $
#
###################################################################################*/
@@ -108,6 +108,7 @@
{
ntypTag = 1,
ntypStartTag = 1 + 0x20,
+ ntypStartEndTag = 1 + 0x80,
ntypEndTag = 1 + 0x40,
ntypEndStartTag = 1 + 0x60,
ntypAttr = 2,
1.4.2.28 +24 -3 embperl/Attic/epparse.c
Index: epparse.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epparse.c,v
retrieving revision 1.4.2.27
retrieving revision 1.4.2.28
diff -u -r1.4.2.27 -r1.4.2.28
--- epparse.c 2001/06/25 03:30:04 1.4.2.27
+++ epparse.c 2001/07/25 04:03:12 1.4.2.28
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epparse.c,v 1.4.2.27 2001/06/25 03:30:04 richter Exp $
+# $Id: epparse.c,v 1.4.2.28 2001/07/25 04:03:12 richter Exp $
#
###################################################################################*/
@@ -623,6 +623,9 @@
if (pToken -> bRemoveSpaces & 2)
while (isspace (*pCurr))
pCurr++ ;
+ else if (pToken -> bRemoveSpaces & 8)
+ while ((*pCurr == ' ' || *pCurr == '\t' || *pCurr == '\r'))
+ pCurr++ ;
if (pToken -> sNodeName)
pNodeName = pToken -> sNodeName ;
@@ -660,6 +663,9 @@
if (pToken -> bRemoveSpaces & 1)
while (pEnd >= pCurrStart && isspace (*pEnd))
pEnd-- ;
+ else if (pToken -> bRemoveSpaces & 4)
+ while (pEnd >= pCurrStart && (*pEnd == ' ' || *pEnd ==
'\t' || *pEnd == '\r'))
+ pEnd-- ;
if (bUnescape)
{
@@ -723,7 +729,11 @@
if (pToken -> nNodeType != ntypCDATA || pToken -> sNodeName)
{
/* add token as node if not cdata*/
- if (!(xNewNode = Node_appendChild (pDomTree, pToken ->
nNodeType, (nCDataType == ntypAttrValue && pToken -> nNodeType != ntypAttr)?(pToken ->
nForceType?2:1):0, pNodeName, strlen (pNodeName), xParentNode, level, GetLineNoOf (r,
pCurrTokenStart))))
+ tNodeType nType = pToken -> nNodeType ;
+ if (nType == ntypStartEndTag)
+ nType = ntypStartTag ;
+
+ if (!(xNewNode = Node_appendChild (pDomTree, nType,
(nCDataType == ntypAttrValue && pToken -> nNodeType != ntypAttr)?(pToken ->
nForceType?2:1):0, pNodeName, strlen (pNodeName), xParentNode, level, GetLineNoOf (r,
pCurrTokenStart))))
{
r -> Buf.pCurrPos = pCurrTokenStart ;
@@ -803,11 +813,22 @@
if ((rc = ExecParseTimeCode (r, pToken, pCurr,
pEndCurr - pCurr, nLine)) != ok)
return rc ;
}
+
+ if (pToken -> nNodeType == ntypStartEndTag)
+ {
+ //level-- ;
+ xParentNode = Node_parentNode (pDomTree, xNewNode) ;
+ pToken = NULL ;
+ }
+
+
pCurr = pEndCurr + nSkip ;
}
}
- if (pToken && (pToken -> nNodeType == ntypStartTag || pToken ->
nNodeType == ntypEndStartTag))
+ if (pToken && (pToken -> nNodeType == ntypStartTag ||
+ pToken -> nNodeType == ntypEndStartTag ||
+ pToken -> nNodeType == ntypStartEndTag))
{
level++ ;
xParentNode = xNewNode ;
No revision
No revision
1.1.4.39 +13 -3 embperl/Embperl/Attic/Syntax.pm
Index: Syntax.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Attic/Syntax.pm,v
retrieving revision 1.1.4.38
retrieving revision 1.1.4.39
diff -u -r1.1.4.38 -r1.1.4.39
--- Syntax.pm 2001/05/11 07:14:18 1.1.4.38
+++ Syntax.pm 2001/07/25 04:03:13 1.1.4.39
@@ -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.38 2001/05/11 07:14:18 richter Exp $
+# $Id: Syntax.pm,v 1.1.4.39 2001/07/25 04:03:13 richter Exp $
#
###################################################################################
@@ -25,6 +25,7 @@
use constant ntypTag => 1 ;
use constant ntypStartTag => 1 + 0x20 ;
+use constant ntypStartEndTag => 1 + 0x80 ;
use constant ntypEndTag => 1 + 0x40 ;
use constant ntypEndStartTag => 1 + 0x60 ;
use constant ntypAttr => 2 ;
@@ -46,6 +47,7 @@
@EXPORT_OK = qw{
ntypTag
ntypStartTag
+ntypStartEndTag
ntypEndTag
ntypEndStartTag
ntypAttr
@@ -766,11 +768,19 @@
=item 1
-Remove spaces before tag
+Remove all white spaces before tag
=item 2
-Remove spaces after tag
+Remove all white spaces after tag
+
+=item 4
+
+Remove spaces and tabs before tag
+
+=item 8
+
+Remove spaces and tabs after tag
=back
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]