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...@apache.org on 2001/11/29 08:32:41 UTC
cvs commit: embperl/test/html/pod pod.asc
richter 01/11/28 23:32:40
Modified: . Tag: Embperl2c Changes.pod epdat.h epparse.c
test.pl
Embperl Tag: Embperl2c Syntax.pm
Embperl/Syntax Tag: Embperl2c POD.pm
test/cmp Tag: Embperl2c pod.asc
test/html/pod Tag: Embperl2c pod.asc
Log:
Embperl 2 - better pod parser
Revision Changes Path
No revision
No revision
1.129.4.43 +6 -0 embperl/Changes.pod
Index: Changes.pod
===================================================================
RCS file: /home/cvs/embperl/Changes.pod,v
retrieving revision 1.129.4.42
retrieving revision 1.129.4.43
diff -u -r1.129.4.42 -r1.129.4.43
--- Changes.pod 2001/11/27 10:43:36 1.129.4.42
+++ Changes.pod 2001/11/29 07:32:39 1.129.4.43
@@ -1,5 +1,11 @@
=pod
+=head1 2.0b6
+
+ - Enhanced POD parser. Now generates a similar output as pod2xml,
+ which is better suitable for XSLT processing. Also the POD
+ parser now can pasers POD out of other Embperl files.
+
=head1 2.0b5 (BETA) 27. Nov. 2001
- Add xsltparam parameter which takes a hashref and is used to
1.20.4.36 +5 -1 embperl/epdat.h
Index: epdat.h
===================================================================
RCS file: /home/cvs/embperl/epdat.h,v
retrieving revision 1.20.4.35
retrieving revision 1.20.4.36
diff -u -r1.20.4.35 -r1.20.4.36
--- epdat.h 2001/11/23 12:28:20 1.20.4.35
+++ epdat.h 2001/11/29 07:32:39 1.20.4.36
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epdat.h,v 1.20.4.35 2001/11/23 12:28:20 richter Exp $
+# $Id: epdat.h,v 1.20.4.36 2001/11/29 07:32:39 richter Exp $
#
###################################################################################*/
@@ -119,6 +119,9 @@
int bRemoveSpaces ; /* 1 remove spaces before tag, 2 remove after */
unsigned char * pContains ; /* chars that could be contained in the string */
int bInsideMustExist ; /* if inside definition doesn't exists, ignore whole tag */
+ int bMatchAll ; /* match any start text */
+ int bDontEat ; /* don't eat the characters when parsing this token (look ahead) */
+ int bExitInside ;/* when this tag is found exit the inside table */
struct tTokenTable * pFollowedBy;/* table of tokens that can follow this one */
struct tTokenTable * pInside ; /* table of tokens that can apear inside this one */
struct tToken * pStartTag ; /* token that contains definition for the start of the current token */
@@ -130,6 +133,7 @@
{
void * pCompilerInfo ; /* stores tables of the compiler , must be first item */
const char * sName ; /* name of syntax */
+ const char * sRootNode ; /* name of root node */
tCharMap cStartChars ; /* for every vaild start char there is one bit set */
tCharMap cAllChars ; /* for every vaild char there is one bit set */
struct tToken * pTokens ; /* table with all tokens */
1.4.2.46 +69 -25 embperl/Attic/epparse.c
Index: epparse.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epparse.c,v
retrieving revision 1.4.2.45
retrieving revision 1.4.2.46
diff -u -r1.4.2.45 -r1.4.2.46
--- epparse.c 2001/11/23 04:46:11 1.4.2.45
+++ epparse.c 2001/11/29 07:32:39 1.4.2.46
@@ -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.45 2001/11/23 04:46:11 richter Exp $
+# $Id: epparse.c,v 1.4.2.46 2001/11/29 07:32:39 richter Exp $
#
###################################################################################*/
@@ -224,6 +224,7 @@
struct tToken * pTable ;
struct tToken * p ;
IV l ;
+ STRLEN len ;
int n ;
int i ;
unsigned char * pStartChars = pTokenTable -> cStartChars ;
@@ -239,6 +240,7 @@
pTokenTable -> nDefNodeType = ntypCDATA ;
pTokenTable -> pContainsToken = NULL ;
pTokenTable -> pCompilerInfo = NULL ;
+ pTokenTable -> sRootNode = NULL ;
pTokenTable -> sName = sName ;
if (ppCompilerInfo == NULL)
ppCompilerInfo = &pTokenTable -> pCompilerInfo ;
@@ -272,6 +274,10 @@
if (*pKey == '-')
{ /* special key */
+ if (strcmp (pKey, "-rootnode") == 0)
+ {
+ pTokenTable -> sRootNode = sstrdup (SvPV((SV *)pToken, len)) ;
+ }
if (strcmp (pKey, "-defnodetype") == 0)
{
pTokenTable -> nDefNodeType = SvIV ((SV *)pToken) ;
@@ -318,7 +324,7 @@
p = &pTable[n] ;
p -> sName = pKey ;
p -> sText = GetHashValueStrDup (pHash, "text", "") ;
- p -> nTextLen = strlen (p -> sText) ;
+ p -> nTextLen = p -> sText?strlen (p -> sText):0 ;
p -> sEndText = GetHashValueStrDup (pHash, "end", (char *)pDefEnd) ;
p -> sNodeName = GetHashValueStrDup (pHash, "nodename", NULL) ;
p -> nNodeType = GetHashValueInt (pHash, "nodetype", ntypTag) ;
@@ -328,6 +334,9 @@
p -> nForceType = GetHashValueInt (pHash, "forcetype", 0) ;
p -> bRemoveSpaces = GetHashValueInt (pHash, "removespaces", p -> nNodeType != ntypCDATA?2:0) ;
p -> bInsideMustExist = GetHashValueInt (pHash, "insidemustexist", 0) ;
+ p -> bMatchAll = GetHashValueInt (pHash, "matchall", 0) ;
+ p -> bDontEat = GetHashValueInt (pHash, "donteat", 0) ;
+ p -> bExitInside= GetHashValueInt (pHash, "exitinside", 0) ;
p -> pStartTag = (struct tToken *)GetHashValueStrDup (pHash, "starttag", NULL) ;
p -> pEndTag = (struct tToken *)GetHashValueStrDup (pHash, "endtag", NULL) ;
p -> sParseTimePerlCode = GetHashValueStrDup (pHash, "parsetimeperlcode", NULL) ;
@@ -350,17 +359,22 @@
else
p -> pContains = NULL ;
- c = p -> sText ;
- pStartChars [toupper(*c) >> 3] |= 1 << (toupper(*c) & 7) ;
- pStartChars [tolower(*c) >> 3] |= 1 << (tolower(*c) & 7) ;
+ if (p -> bMatchAll)
+ {
+ memset (pStartChars, 0xff, sizeof(tCharMap)) ;
+ }
+ else if ((c = p -> sText))
+ {
+ pStartChars [toupper(*c) >> 3] |= 1 << (toupper(*c) & 7) ;
+ pStartChars [tolower(*c) >> 3] |= 1 << (tolower(*c) & 7) ;
- while (*c)
- {
- pAllChars [tolower(*c) >> 3] |= 1 << (tolower(*c) & 7) ;
- pAllChars [toupper(*c) >> 3] |= 1 << (toupper(*c) & 7) ;
- c++ ;
- }
-
+ while (*c)
+ {
+ pAllChars [tolower(*c) >> 3] |= 1 << (tolower(*c) & 7) ;
+ pAllChars [toupper(*c) >> 3] |= 1 << (toupper(*c) & 7) ;
+ c++ ;
+ }
+ }
if (r -> bDebug & dbgBuildToken)
lprintf (r, "[%d]TOKEN: %*c%s ... %s unesc=%d nodetype=%d, cdatatype=%d, nodename=%s contains='%s'\n", r -> nPid, nLevel*2, ' ', p -> sText, p -> sEndText, p -> bUnescape, p -> nNodeType, p -> nCDataType, p -> sNodeName?p -> sNodeName:"<null>", sC?sC:"") ;
@@ -562,7 +576,8 @@
tNode xParentNode,
int level,
char * pCDATAStart,
- const char * sStopText)
+ const char * sStopText,
+ int bDontEat)
{
unsigned char * pStartChars = pTokenTable -> cStartChars ;
@@ -573,6 +588,7 @@
tNode xNewNode ;
int rc ;
tDomTree * pDomTree = DomTree_self (r -> xCurrDomTree) ;
+ int numInside = 0 ;
if (nEndText == 0 && sStopText)
{
@@ -617,17 +633,22 @@
for (i = 0, pToken = pTokenTab; i < numTokens; i++, pToken++)
{
+ if (pToken -> bMatchAll && (numInside == 0 || pToken -> bMatchAll > 0))
+ {
+ r = 0 ;
+ break ;
+ }
if (pToken -> nTextLen == 0)
continue ;
r = strnicmp (pCurr, pToken -> sText, pToken -> nTextLen) ;
/* if ((r == 0 && !(pAllChars [pCurr[pToken -> nTextLen] >> 3] & (1 << (pCurr[pToken -> nTextLen] & 7)))) || */
if (r == 0 ||
- *pCurr > *(pToken -> sText))
+ (*pCurr > *(pToken -> sText) && pStartChars[0] != 0xff))
break ;
}
if (r != 0)
pToken = NULL ;
- else
+ else if (!pToken -> bMatchAll && (pToken -> bDontEat & 1) == 0)
pCurr += pToken -> nTextLen ;
}
else
@@ -648,7 +669,8 @@
if (pToken)
{
- if (pToken -> bRemoveSpaces & 2)
+ numInside++ ;
+ if (pToken -> bRemoveSpaces & 2)
while (isspace (*pCurr))
pCurr++ ;
else if (pToken -> bRemoveSpaces & 8)
@@ -657,7 +679,7 @@
if (pToken -> sNodeName)
nNodeName = pToken -> nNodeName ;
- }
+ }
else
{
pToken = pNextTokenTab -> pContainsToken ;
@@ -724,6 +746,8 @@
{ /* end token found */
tNodeData * pStartTag ;
char * pEndCurr = strstr (pCurr, pToken -> sEndText) ;
+ if (!pEndCurr && pToken -> sEndText[0] == '\n' && pToken -> sEndText[1] == '\n' && sEndText[2] == '\0')
+ pEndCurr = strstr (pCurr, "\n\r\n") ;
if (pEndCurr)
{
tNode xNewAttrNode ;
@@ -756,7 +780,9 @@
level-- ;
xParentNode = Node_parentNode (pDomTree, xParentNode, 0) ;
pStartTag = Node_selfLastChild (pDomTree, Node_self (pDomTree, xParentNode), 0) ;
- if (pToken -> pStartTag == NULL || pStartTag -> nText != pToken -> pStartTag -> nNodeName)
+ if (pStartTag -> nText != pToken -> nNodeName &&
+ (pToken -> pStartTag == NULL
+ || pStartTag -> nText != pToken -> pStartTag -> nNodeName))
{
strncpy (r -> errdat2, Ndx2String (pStartTag -> nText), sizeof (r -> errdat2)) ;
strncpy (r -> errdat1, Ndx2String (pToken -> nNodeName), sizeof (r -> errdat1)) ;
@@ -771,7 +797,7 @@
xParentNode = Node_parentNode (pDomTree, xParentNode, 0) ;
level-- ;
}
- if (pToken -> nNodeType != ntypCDATA || pToken -> sNodeName)
+ if (pToken -> nNodeType && pToken -> nNodeType != ntypCDATA || pToken -> sNodeName)
{
/* add token as node if not cdata*/
tNodeType nType = pToken -> nNodeType ;
@@ -808,7 +834,8 @@
xNewNode,
level+1,
pToken -> nNodeType == ntypCDATA?pCurrTokenStart:NULL,
- sEndText && *sEndText?sEndText:NULL) ;
+ sEndText && *sEndText?sEndText:NULL,
+ pToken -> bDontEat) ;
if (rc == ok)
bInsideMustExist = 0 ;
else if (pToken -> bInsideMustExist && rc == rcNotFound)
@@ -943,7 +970,8 @@
return bInsideMustExist?rcNotFound:ok ;
}
else if (sEndText == NULL ||
- (*pCurr == *sEndText && strncmp (pCurr, sEndText, nEndText) == 0))
+ (*pCurr == *sEndText && (strncmp (pCurr, sEndText, nEndText) == 0) ||
+ (pCurr[0] == '\n' && pCurr[1] == '\r' && pCurr[2] == '\n' && sEndText[1] == '\n' && sEndText[2] == '\0')))
{
char * pEnd ;
if (pCDATAStart)
@@ -963,13 +991,19 @@
GetLineNoOf (r, pCurr), NULL)))
return 1 ;
- if (!pCDATAStart && !sStopText)
+ if (!pCDATAStart && !sStopText && (bDontEat & 2) == 0)
pCurr += nEndText ;
*ppCurr = pCurr ;
return bInsideMustExist?rcNotFound:ok ;
}
else if (!pToken && bFollow < 2)
pCurr++ ;
+
+ if (pToken && (pToken -> bExitInside))
+ {
+ *ppCurr = pCurr ;
+ return ok ;
+ }
}
if (nCDataType && pCurr - pCurrStart)
@@ -1022,6 +1056,7 @@
char * pEnd = pSource + nLen ;
int rc ;
tNode xDocNode ;
+ tNode xDocNode2 ;
tNode xNode ;
tTokenTable * pTokenTableSave ;
clock_t cl1 = clock () ;
@@ -1043,6 +1078,15 @@
NULL, r -> bSubReq?xDocumentFraq:xDocument, 0, 0, NULL)))
return rcOutOfMemory ;
+ xDocNode2 = xDocNode ;
+ if (r -> pTokenTable -> sRootNode)
+ if (!(xDocNode2 = Node_appendChild (pDomTree, xDocNode, 0, ntypStartTag, 0,
+ r -> pTokenTable -> sRootNode,
+ strlen (r -> pTokenTable -> sRootNode),
+ 0, 0, NULL)))
+ return rcOutOfMemory ;
+
+
if (!(xNode = Node_appendChild (pDomTree, xDocNode, 0, ntypAttr, 0, NULL, xDomTreeAttr, 0, 0, NULL)))
return rcOutOfMemory ;
@@ -1050,18 +1094,18 @@
return rcOutOfMemory ;
/* Add at least one child node to document to make insertafter at the beginning of the document work */
- if (!(xNode = Node_appendChild (pDomTree, xDocNode, 0, ntypCDATA, 0, "", 0, 0, 0, NULL)))
+ if (!(xNode = Node_appendChild (pDomTree, xDocNode2, 0, ntypCDATA, 0, "", 0, 0, 0, NULL)))
return rcOutOfMemory ;
pDomTree -> xDocument = xDocNode ;
pTokenTableSave = r -> pTokenTable ;
- if ((rc = ParseTokens (r, &pStart, pEnd, r -> pTokenTable, "", NULL, r -> pTokenTable -> nDefNodeType, 0, 0, 0, 0, String2Ndx("root", 4), xDocNode, 0, NULL, NULL)) != ok)
+ if ((rc = ParseTokens (r, &pStart, pEnd, r -> pTokenTable, "", NULL, r -> pTokenTable -> nDefNodeType, 0, 0, 0, 0, String2Ndx("root", 4), xDocNode2, 0, NULL, NULL, 0)) != ok)
return rc ;
/* Add one child node end the end to catch loops that end at the very last node */
- if (!(xNode = Node_appendChild (pDomTree, xDocNode, 0, ntypCDATA, 0, "", 0, 0, 0, NULL)))
+ if (!(xNode = Node_appendChild (pDomTree, xDocNode2, 0, ntypCDATA, 0, "", 0, 0, 0, NULL)))
return rcOutOfMemory ;
r -> pTokenTable = pTokenTableSave ;
1.70.4.102 +2 -2 embperl/test.pl
Index: test.pl
===================================================================
RCS file: /home/cvs/embperl/test.pl,v
retrieving revision 1.70.4.101
retrieving revision 1.70.4.102
diff -u -r1.70.4.101 -r1.70.4.102
--- test.pl 2001/11/23 12:30:27 1.70.4.101
+++ test.pl 2001/11/29 07:32:40 1.70.4.102
@@ -11,7 +11,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test.pl,v 1.70.4.101 2001/11/23 12:30:27 richter Exp $
+# $Id: test.pl,v 1.70.4.102 2001/11/29 07:32:40 richter Exp $
#
###################################################################################
@@ -730,7 +730,7 @@
'pod/pod.asc' => {
'version' => 2,
'syntax' => 'POD',
- 'condition' => '!$EPWIN32',
+ #'condition' => '!$EPWIN32',
'cgi' => 0,
},
'xml/pod.xml' => {
No revision
No revision
1.1.4.48 +5 -1 embperl/Embperl/Attic/Syntax.pm
Index: Syntax.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Attic/Syntax.pm,v
retrieving revision 1.1.4.47
retrieving revision 1.1.4.48
diff -u -r1.1.4.47 -r1.1.4.48
--- Syntax.pm 2001/11/22 11:04:14 1.1.4.47
+++ Syntax.pm 2001/11/29 07:32:40 1.1.4.48
@@ -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.47 2001/11/22 11:04:14 richter Exp $
+# $Id: Syntax.pm,v 1.1.4.48 2001/11/29 07:32:40 richter Exp $
#
###################################################################################
@@ -568,6 +568,10 @@
End text
+=item 'matchall'
+
+when set to 1 new token starts at next character, when set to -1 new token
+starts at next character, but only if it is the first token inside another one.
=item 'nodename'
No revision
No revision
1.1.2.5 +283 -34 embperl/Embperl/Syntax/Attic/POD.pm
Index: POD.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/POD.pm,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- POD.pm 2001/09/20 13:27:31 1.1.2.4
+++ POD.pm 2001/11/29 07:32:40 1.1.2.5
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: POD.pm,v 1.1.2.4 2001/09/20 13:27:31 richter Exp $
+# $Id: POD.pm,v 1.1.2.5 2001/11/29 07:32:40 richter Exp $
#
###################################################################################
@@ -22,7 +22,7 @@
use HTML::Embperl::Syntax::EmbperlBlocks ;
use strict ;
-use vars qw{@ISA %Tags %Format %Escape} ;
+use vars qw{@ISA %Tags %Format %Escape %Para %ParaItem %ParaTitle %List %Search} ;
@@ -51,14 +51,14 @@
if (!$self -> {-PODTags})
{
- $self -> {-PODTags} = $self -> CloneHash (\%Tags) ;
+ $self -> {-PODTags} = $self -> CloneHash (\%Search) ;
$self -> AddToRoot ($self -> {-PODTags}) ;
- $self -> AddToRoot ({'-defnodetype' => ntypText,}) ;
+ #$self -> AddToRoot ({'-defnodetype' => ntypText,}) ;
- $self -> {-PODCmds} = $self -> {-PODTags}{'POD Command'}{'follow'} ;
- Init ($self) ;
+ #$self -> {-PODCmds} = $self -> {-PODTags}{'POD Command'}{'follow'} ;
+ #Init ($self) ;
}
return $self ;
@@ -130,7 +130,7 @@
{
my ($self) = @_ ;
- $self -> AddPODCmd ('head1') ;
+ #$self -> AddPODCmd ('head1') ;
$self -> AddPODCmd ('head2') ;
$self -> AddPODCmd ('head3') ;
$self -> AddPODStartEnd ('over', 'back', 'list') ;
@@ -182,67 +182,316 @@
'POD Format B' => {
'text' => 'B<',
'end' => '>',
- 'nodename' => 'B',
+ 'nodename' => 'strong',
'nodetype' => ntypStartEndTag,
},
'POD Format C' => {
'text' => 'C<',
'end' => '>',
- 'nodename' => 'CODE',
+ 'nodename' => 'code',
'nodetype' => ntypStartEndTag,
},
'POD Format I' => {
'text' => 'I<',
'end' => '>',
- 'nodename' => 'I',
+ 'nodename' => 'emphasis',
'nodetype' => ntypStartEndTag,
},
'POD Format U' => {
'text' => 'U<',
'end' => '>',
- 'nodename' => 'U',
+ 'nodename' => 'underline',
'nodetype' => ntypStartEndTag,
},
'POD Format L' => {
'text' => 'L<',
'end' => '>',
- 'nodename' => 'L',
+ 'nodename' => 'xlink:ref',
'nodetype' => ntypStartEndTag,
},
) ;
-%Tags = (
+my $paraend = "\n\n" ;
+
+%List =
+ (
'-lsearch' => 1,
'-defnodetype' => ntypText,
- 'POD Command' => {
- 'text' => '=',
- 'end' => "\n",
- 'cdatatype' => ntypAttrValue,
- 'follow' => {'-lsearch' => 1},
- },
- 'POD Emptyline' => {
- 'text' => "\n\n",
- 'nodename' => 'BR/',
- 'nodetype' => ntypTag,
+ 'liststart' => {
+ 'text' => '=over',
+ 'end' => "\n",
+ 'nodetype' => ntypStartTag,
+ 'cdatatype' => 0,
+ 'removespaces' => 72,
+ 'nodename' => 'list',
+ },
+ 'listend' => {
+ 'text' => '=back',
+ 'end' => "\n",
+ 'nodetype' => ntypEndTag,
+ 'cdatatype' => 0,
+ 'nodename' => 'list',
+ 'removespaces' => 72,
+ },
+ 'item' => {
+ 'text' => '=item',
+ 'end' => '=item',
+ 'donteat' => 2,
+ 'nodetype' => ntypStartEndTag,
+ 'nodename' => 'item',
+ 'removespaces' => 2,
+ 'inside' => \%ParaItem,
},
-# 'POD Emptyline' => {
-# 'text' => "\r\n\r\n",
-# 'nodename' => 'BR/',
-# 'nodetype' => ntypTag,
-# },
- 'POD Code' => {
- 'text' => "\n ",
- 'end' => "\n",
- 'nodename' => 'PRE',
+ ) ;
+
+
+%Para =
+ (
+ %List,
+ 'para' =>
+ {
+ 'matchall' => 1,
+ 'text' => "\0x01", # gives sort order
+ 'end' => $paraend,
+ 'cdatatype' => ntypText,
+ 'nodename' => 'para',
+ 'removespaces' => 72,
+ 'inside' => \%Format,
+ 'nodetype' => ntypStartEndTag,
+ },
+ 'verbatim' =>
+ {
+ 'text' => " ",
+ 'end' => $paraend,
'cdatatype' => ntypText,
+ 'nodename' => 'verbatim',
+ 'removespaces' => 0,
+ 'inside' => \%Format,
'nodetype' => ntypStartEndTag,
- 'inside' => \%Format,
+ 'donteat' => 1,
},
- %Format,
+ 'skip' =>
+ {
+ 'text' => "\n",
+ 'contains' => "\r\n",
+ 'nodetype' => ntypCDATA,
+ },
) ;
+%ParaTitle =
+ (
+ 'title' =>
+ {
+ 'matchall' => -1, # only match first time after =head
+ 'text' => "\x02", # gives sort order
+ 'end' => $paraend,
+ 'cdatatype' => ntypText,
+ 'nodename' => 'title',
+ 'removespaces' => 72,
+ 'inside' => \%Format,
+ 'nodetype' => ntypStartEndTag,
+ },
+ %Para,
+ ) ;
+%ParaItem =
+ (
+ %Para,
+ 'itemtext' =>
+ {
+ 'matchall' => -1, # only match first time after =head
+ 'text' => "\x02", # gives sort order
+ 'end' => $paraend,
+ 'cdatatype' => ntypText,
+ 'nodename' => 'itemtext',
+ 'removespaces' => 72,
+ 'inside' => \%Format,
+ 'nodetype' => ntypStartEndTag,
+ },
+ 'item' => {
+ 'text' => '=item',
+ 'nodename' => 'item',
+ 'nodetype' => ntypEndTag,
+ 'donteat' => 1,
+ 'exitinside' => 1,
+ },
+ 'listend' => {
+ 'text' => '=back',
+ 'nodename' => 'item',
+ 'nodetype' => ntypEndTag,
+ 'donteat' => 1,
+ 'exitinside' => 1,
+ },
+ ) ;
+
+%Tags =
+ (
+ '-lsearch' => 1,
+ '-defnodetype' => ntypText,
+ 'head1name' => {
+ 'text' => '=head1 NAME',
+ 'end' => '=head1',
+ 'donteat' => 2,
+ 'nodetype' => ntypStartEndTag,
+ 'nodename' => 'head',
+ 'removespaces' => 2,
+ 'inside' => {
+ '-lsearch' => 1,
+ 'title' =>
+ {
+ 'matchall' => -1, # only match first time after =head
+ 'text' => "\x02", # gives sort order
+ 'end' => $paraend,
+ 'cdatatype' => ntypText,
+ 'nodename' => 'title',
+ 'removespaces' => 72,
+ 'inside' => \%Format,
+ 'nodetype' => ntypStartEndTag,
+ },
+ },
+ },
+ 'head1' => {
+ 'text' => '=head1',
+ 'end' => '=head1',
+ 'donteat' => 2,
+ 'nodetype' => ntypStartEndTag,
+ 'nodename' => 'sect1',
+ 'removespaces' => 2,
+ 'inside' => {
+ '-lsearch' => 1,
+ %ParaTitle,
+ 'head1' => {
+ 'text' => '=head1',
+ 'nodename' => 'sect1',
+ 'nodetype' => ntypEndTag,
+ 'donteat' => 1,
+ 'exitinside' => 1,
+ },
+ 'cut' => {
+ 'text' => '=cut',
+ 'nodename' => 'sect1',
+ 'nodetype' => ntypEndTag,
+ 'donteat' => 1,
+ 'exitinside' => 1,
+ },
+ 'head2' => {
+ 'text' => '=head2',
+ 'end' => '=head2',
+ 'donteat' => 2,
+ 'nodetype' => ntypStartEndTag,
+ 'nodename' => 'sect2',
+ 'removespaces' => 2,
+ 'inside' => {
+ '-lsearch' => 1,
+ %ParaTitle,
+ 'head1' => {
+ 'text' => '=head1',
+ 'nodename' => 'sect2',
+ 'nodetype' => ntypEndTag,
+ 'cdatatype' => 0,
+ 'donteat' => 1,
+ 'exitinside' => 1,
+ },
+ 'head2' => {
+ 'text' => '=head2',
+ 'nodetype' => ntypEndTag,
+ 'nodename' => 'sect2',
+ 'donteat' => 1,
+ 'exitinside' => 1,
+ },
+ 'cut' => {
+ 'text' => '=cut',
+ 'nodetype' => ntypEndTag,
+ 'nodename' => 'sect2',
+ 'donteat' => 1,
+ 'exitinside' => 1,
+ },
+ 'head3' => {
+ 'text' => '=head3',
+ 'end' => '=head3',
+ 'donteat' => 2,
+ 'nodetype' => ntypStartEndTag,
+ 'nodename' => 'sect3',
+ 'removespaces' => 2,
+ 'inside' => {
+ '-lsearch' => 1,
+ %ParaTitle,
+ 'head1' => {
+ 'text' => '=head1',
+ 'nodename' => 'sect3',
+ 'nodetype' => ntypEndTag,
+ 'cdatatype' => 0,
+ 'donteat' => 1,
+ 'exitinside' => 1,
+ },
+ 'head2' => {
+ 'text' => '=head2',
+ 'nodetype' => ntypEndTag,
+ 'cdatatype' => 0,
+ 'nodename' => 'sect3',
+ 'donteat' => 1,
+ 'exitinside' => 1,
+ },
+ 'head3' => {
+ 'text' => '=head3',
+ 'nodetype' => ntypEndTag,
+ 'nodename' => 'sect3',
+ 'donteat' => 1,
+ 'exitinside' => 1,
+ },
+ 'cut' => {
+ 'text' => '=cut',
+ 'nodetype' => ntypEndTag,
+ 'nodename' => 'sect3',
+ 'donteat' => 1,
+ 'exitinside' => 1,
+ },
+ },
+ },
+ },
+ },
+ },
+ },
+ 'cut' => {
+ 'text' => '=cut',
+ 'nodetype' => 0,
+ 'cdatatype' => 0,
+ 'exitinside' => 1,
+ },
+# %Para,
+ ) ;
+
+%Search =
+ (
+ '-lsearch' => 1,
+ '-defnodetype' => 0,
+ '-rootnode' => 'pod',
+ 'start' => {
+ 'text' => "\n=",
+ 'donteat' => 1,
+ 'nodetype' => 0,
+ 'cdatatype' => 0,
+ 'removespaces' => 2,
+ 'inside' => \%Tags
+ },
+ 'startpod' => {
+ 'text' => '=pod',
+ 'end' => "\n",
+ 'nodetype' => 0,
+ 'cdatatype' => 0,
+ 'removespaces' => 2,
+ 'inside' => \%Tags
+ },
+ 'startpod2' => {
+ 'text' => "\n=pod",
+ 'end' => "\n",
+ 'nodetype' => 0,
+ 'cdatatype' => 0,
+ 'removespaces' => 2,
+ 'inside' => \%Tags
+ },
+ ) ;
1;
No revision
No revision
1.1.2.2 +21 -13 embperl/test/cmp/Attic/pod.asc
Index: pod.asc
===================================================================
RCS file: /home/cvs/embperl/test/cmp/Attic/pod.asc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- pod.asc 2001/09/17 09:40:50 1.1.2.1
+++ pod.asc 2001/11/29 07:32:40 1.1.2.2
@@ -1,15 +1,23 @@
+<pod><head><title>Test pod for Embperl</title>
+</head><sect1><title>HEAD1</title>
-<pod>
-<head1>HEAD1</head1>
-some text under HEAD1<BR/><head2>HEAD2</head2>
-some text under HEAD2<BR/><head3>HEAD3</head3>
-some text under HEAD3<BR/>format <B>bold</B> <CODE>code</CODE> <I>italic</I> <U>underline</U>
+<para>some text under HEAD1</para><para>more text under HEAD1</para>
+<verbatim> some verbatim
+ paragraph
</verbatim><para>normal text
+wraps around</para>
-<list>
-<item>first item</item>
-text 1<BR/><item>second item</item>
-text 2<BR/></list><BR/><list>
-<bulletitem>first item</bulletitem>
-text 1<BR/><bulletitem>second item</bulletitem>
-text 2<BR/></list><BR/></pod>
-
+<sect2><title>HEAD2</title><para>some text under HEAD2</para></sect2><sect2><title>second HEAD2 which
+wraps to the next line</title><para>some text under HEAD2 which
+also warps to the next line</para><para>another paragraph is
+this</para><sect3><title>HEAD3</title><para>some text under HEAD3</para></sect3></sect2><sect2><title>third HEAD2 which
+wraps to the next line</title><para>some text under HEAD2 which
+also warps to the next line</para><para>format
+<strong>bold</strong>
+<code>code</code>
+<emphasis>italic</emphasis>
+<underline>underline</underline></para><list><item><itemtext>first item</itemtext><para>text 1</para></item><item><itemtext>second item</itemtext><para>text 2</para></item></list>
+<list><item><itemtext>* first item</itemtext><para>text 1
+two lines</para></item><item><itemtext>* second item</itemtext><para>text 2
+two lines</para></item></list>
+</sect2></sect1><sect1><title>again HEAD1
+and second line of title</title><para>again some text under HEAD1</para><sect2><title>again HEAD2</title><para>again some text under HEAD2</para></sect2></sect1><sect1><title>restart</title><para>some text</para></sect1><sect1><title>restart 2</title><sect2><title>restart 2 Head 2</title><para>text</para></sect2></sect1><sect1><title>restart 2</title><sect2><title>restart 2 Head 2</title></sect2></sect1></pod>
No revision
No revision
1.1.2.3 +85 -1 embperl/test/html/pod/Attic/pod.asc
Index: pod.asc
===================================================================
RCS file: /home/cvs/embperl/test/html/pod/Attic/pod.asc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- pod.asc 2001/09/17 09:22:19 1.1.2.2
+++ pod.asc 2001/11/29 07:32:40 1.1.2.3
@@ -1,19 +1,56 @@
+something before
=pod
+=head1 NAME
+
+Test pod for Embperl
+
=head1 HEAD1
+
+
some text under HEAD1
+more text under HEAD1
+
+
+ some verbatim
+ paragraph
+
+normal text
+wraps around
+
+
+
=head2 HEAD2
some text under HEAD2
+=head2 second HEAD2 which
+wraps to the next line
+
+some text under HEAD2 which
+also warps to the next line
+
+another paragraph is
+this
+
=head3 HEAD3
some text under HEAD3
+
+=head2 third HEAD2 which
+wraps to the next line
+
+some text under HEAD2 which
+also warps to the next line
-format B<bold> C<code> I<italic> U<underline>
+format
+B<bold>
+C<code>
+I<italic>
+U<underline>
=over 4
@@ -33,13 +70,60 @@
=item * first item
text 1
+two lines
=item * second item
text 2
+two lines
=back xxx
+=head1 again HEAD1
+and second line of title
+
+again some text under HEAD1
+
+
+=head2 again HEAD2
+
+again some text under HEAD2
+
+
+=cut
+
+This text should be
+not visble
+
+=head1 restart
+
+some text
+
+=cut
+
+This text should be
+not visble2
+
+=head1 restart 2
+
+=head2 restart 2 Head 2
+
+text
+
+=cut
+
+This text should be
+not visble3
+
+=head1 restart 2
+
+=head2 restart 2 Head 2
+
=cut
+
+
+This text should be
+not visble4
+
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org