richter     01/10/30 06:40:16

  Modified:    .        Tag: Embperl2c Changes.pod epcomp.c epdom.c epdom.h
               Embperl/Syntax Tag: Embperl2c EmbperlBlocks.pm
               test/cmp Tag: Embperl2c execprint.htm
               test/html Tag: Embperl2c execprint.htm subimp.pm
  Log:
  Embperl 2 - tree structure rewrite
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.129.4.32 +4 -1      embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.129.4.31
  retrieving revision 1.129.4.32
  diff -u -r1.129.4.31 -r1.129.4.32
  --- Changes.pod       2001/10/25 08:26:02     1.129.4.31
  +++ Changes.pod       2001/10/30 14:40:15     1.129.4.32
  @@ -26,7 +26,10 @@
        same system. This is neccessary to work on Windows in- and outside of
        Apache.
      - Fixed a linkage problem with symbol embperl_module, first reported
  -     by GustavKristoffer Ek.    
  +     by GustavKristoffer Ek.
  +   - Chnages in Embperl's internal tree representation, to fix serveral
  +     small problems and in preparation for proper XML handling.
  +   - print OUT inside loop works now correctly      
   
   =head1 2.0b3 (BETA) 9. July 2001
   
  
  
  
  1.4.2.64  +33 -12    embperl/Attic/epcomp.c
  
  Index: epcomp.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcomp.c,v
  retrieving revision 1.4.2.63
  retrieving revision 1.4.2.64
  diff -u -r1.4.2.63 -r1.4.2.64
  --- epcomp.c  2001/10/29 20:07:12     1.4.2.63
  +++ epcomp.c  2001/10/30 14:40:15     1.4.2.64
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epcomp.c,v 1.4.2.63 2001/10/29 20:07:12 richter Exp $
  +#   $Id: epcomp.c,v 1.4.2.64 2001/10/30 14:40:15 richter Exp $
   #
   
###################################################################################*/
   
  @@ -800,8 +800,22 @@
                        int  l = sprintf (s, "%u", ArrayGetSize (pDomTree -> 
pCheckpoints)) ;
                        StringAdd (ppCode, s, l) ; 
                        }
  -                 }
  +                 else if (*p == 'k')
  +                     {
  +                     char s [40] ;
  +                        int  l ;
  +                     tIndex nCheckpointArrayOffset = ArrayAdd (&pDomTree -> 
pCheckpoints, 1) ;
  +                     pDomTree -> pCheckpoints[nCheckpointArrayOffset].xNode = pNode 
-> xNdx ;
  +                     l = sprintf (s, " _ep_cp(%d) ;\n", nCheckpointArrayOffset) ;
  +                     StringAdd (ppCode, s, l) ; 
   
  +                     if (pCurrReq -> bDebug & dbgCompile)
  +                         lprintf (pCurrReq, "[%d]EPCOMP: #%d L%d Checkpoint\n", 
pCurrReq -> nPid, pNode -> xNdx, pNode -> nLinenumber) ;
  +                        }
  +                    
  +                    
  +                    }
  +
                sPerlCode = q + 1 ;
                p = strchr (sPerlCode, '%') ;   
                }
  @@ -1435,6 +1449,12 @@
        pCmd = pCmd -> pNext ;
        }
   
  +    if (pCmdHead && pCmdHead -> nSwitchCodeType == 2)
  +        {
  +        r -> pProg = &r -> pProgRun ;
  +        nCheckpointArrayOffset = 0 ;
  +        nCheckpointCodeOffset = 0 ;
  +        }
   
   
       return ok ;
  @@ -1824,6 +1844,8 @@
   
       av_push (pSaveAV, newSViv (r -> xCurrDomTree)) ;
       av_push (pSaveAV, newSViv (r -> xCurrNode)) ;
  +    av_push (pSaveAV, newSViv (r -> nCurrRepeatLevel)) ;
  +    av_push (pSaveAV, newSViv (r -> nCurrCheckpoint)) ;
   
       pDomTree = DomTree_self (xDomTree) ;
   
  @@ -1831,10 +1853,11 @@
   
       if (!(r -> xCurrDomTree  = DomTree_clone (pDomTree, &pCurrDomTree, 1)))
            return 0 ;
  +    ArrayNewZero (&pCurrDomTree -> pCheckpointStatus, ArrayGetSize (pCurrDomTree -> 
pCheckpoints), sizeof(tDomTreeCheckpointStatus)) ;
  +    r -> nCurrCheckpoint = 1 ;
  +    r -> nCurrRepeatLevel = 0 ;
  +    pCurrDomTree -> xDocument = 0 ; /* set by first checkpoint */
       
  -    mydie ("pOrder missing in exexcut sub start") ;
  -    //av_push (pSaveAV, newSViv (ArrayGetSize (pCurrDomTree -> pOrder))) ;
  -
       av_push (r -> pDomTreeAV, pCurrDomTree -> pDomTreeSV) ;
       av_push (r -> pCleanupAV, newRV_inc (pDomTreeSV)) ;
   
  @@ -1864,18 +1887,19 @@
       {
       tIndex xSubDomTree = r -> xCurrDomTree ;
       tIndex xDocFraq ;
  -    int    nOrderNdx ;
       tDomTree * pCallerDomTree  ;
       tDomTree * pSubDomTree = DomTree_self (xSubDomTree) ;
   
       if (AvFILL (pSaveAV) < 1)
        return ok ;
       
  -    DomTree_checkpoint (r, -1) ;
  +    ArrayFree (&pSubDomTree -> pCheckpointStatus) ;
  +    /* DomTree_checkpoint (r, -1) ; */
   
       r -> xCurrDomTree = SvIV (* av_fetch (pSaveAV, 0, 0)) ;
       r -> xCurrNode    = SvIV (* av_fetch (pSaveAV, 1, 0)) ;
  -    nOrderNdx         = SvIV (* av_fetch (pSaveAV, 2, 0)) ;
  +    r -> nCurrRepeatLevel = SvIV (* av_fetch (pSaveAV, 2, 0)) ;
  +    r -> nCurrCheckpoint = SvIV (* av_fetch (pSaveAV, 3, 0)) ;
   
       pCallerDomTree = DomTree_self (r -> xCurrDomTree) ;
       /* xDocFraq = Node_replaceChildWithNode (pSubDomTree, pSubDomTree -> xDocument, 
pCallerDomTree, r -> xCurrNode) ; */
  @@ -1962,14 +1986,11 @@
   
            av_push (r -> pCleanupAV, newRV_inc (pDomTreeSV)) ;
            
  -         nCheckpointCache = 0 ;
  -         xCheckpointCache[nCheckpointCache++] = 0 ;
  -         xCheckpointCache[nCheckpointCache++] = 0 ;
  -         
            args[0] = r -> pReqSV ;
            if (sSubName)
                {
                SV * pSVName = newSVpvf ("%s::_ep_sub_%s", r -> Buf.sEvalPackage, 
sSubName) ;
  +                pCurrDomTree -> xDocument = 0 ; /* set by first checkpoint */
                rc = CallStoredCV (r, r -> pProgRun, (CV *)pSVName, 1, args, 0, &pSV) ;
                if (pSVName)
                    SvREFCNT_dec (pSVName) ;
  
  
  
  1.4.2.63  +181 -157  embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.4.2.62
  retrieving revision 1.4.2.63
  diff -u -r1.4.2.62 -r1.4.2.63
  --- epdom.c   2001/10/30 09:05:54     1.4.2.62
  +++ epdom.c   2001/10/30 14:40:15     1.4.2.63
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epdom.c,v 1.4.2.62 2001/10/30 09:05:54 richter Exp $
  +#   $Id: epdom.c,v 1.4.2.63 2001/10/30 14:40:15 richter Exp $
   #
   
###################################################################################*/
   
  @@ -38,11 +38,6 @@
   tIndex xDocumentFraq ;
   tIndex xOrderIndexAttr ;
   
  -int nCheckpointCache = 0 ;
  -int nCheckpointCacheMask = 0x1ff ;
  -tIndex xCheckpointCache[512] ;
  -
  -
   static tUInt8 * MemFree[512] ;
   static tUInt8 * pMemLast = NULL ;
   static tUInt8 * pMemEnd = NULL ;
  @@ -1109,6 +1104,34 @@
       tDomTreeCheckpoint * pCheckpoints = pDomTree -> pCheckpoints ;
       tDomTreeCheckpointStatus * pCheckpointStatus =  &pDomTree -> 
pCheckpointStatus[nRunCheckpoint] ;
   
  +    if (r -> nPhase  != phRun)
  +        return ;
  +    
  +    if (!pDomTree -> xDocument)
  +        {
  +        tNodeData * pDocument ;
  +        tAttrData * pAttr ;
  +
  +        pDomTree -> xDocument = pCheckpoints[nRunCheckpoint].xNode ;
  +        
  +        pDocument = Node_self (pDomTree, pDomTree -> xDocument) ;
  +     pAttr = Element_selfSetAttribut (pDomTree, pDocument, 0, NULL, xDomTreeAttr, 
NULL, pDomTree -> xNdx) ;
  +     pAttr -> bFlags = aflgOK ; /* reset string value flag */
  +        pDocument = Node_self (pDomTree, pDomTree -> xDocument) ;
  +     pDocument -> nType = ntypDocumentFraq ;
  +     if (pDocument -> nText != xDocumentFraq)
  +         {
  +         NdxStringFree (pDocument -> nText) ;
  +         pDocument -> nText = xDocumentFraq ;
  +         NdxStringRefcntInc (xDocumentFraq) ;
  +         }
  +        
  +        
  +        r -> nCurrCheckpoint = nRunCheckpoint+1 ;
  +        r -> nCurrRepeatLevel = 0 ;
  +        return ;
  +        }
  +
       pCheckpointStatus -> nRepeatLevel       = r -> nCurrRepeatLevel ;
       pCheckpointStatus -> nCompileCheckpoint = nCompileCheckpoint ;
       pCheckpointStatus -> xJumpFromNode      = 0 ;
  @@ -1327,7 +1350,7 @@
                            nRunCheckpoint,     pRunNode -> xNdx, 
xNode_selfLevelNull(pDomTree,pRunNode), pRunNode -> nLinenumber, sv_count) ; 
   
               }
  -        else if (xNode_selfLevelNull(pDomTree,pPrevNode) == 
xNode_selfLevelNull(pDomTree,pRunParent2))
  +        else if (pRunParent2 && xNode_selfLevelNull(pDomTree,pPrevNode) == 
xNode_selfLevelNull(pDomTree,pRunParent2))
               {
               if (pCurrReq -> bDebug & dbgCheckpoint)
                lprintf (pCurrReq, "[%d]Checkpoint: jump backward2 DomTree=%d Index=%d 
Node=%d(%d),%d(%d) Line=%d -> Index=%d Node=%d(%d),%d(%d) Line=%d SVs=%d\n", 
  @@ -2772,7 +2795,7 @@
       if (pNode -> xNext == pNode -> xNdx)
           return 0 ;
       
  -    pParent = Node_self (pDomTree, pNode -> xParent, nRepeatLevel) ;
  +    pParent = Node_self (pDomTree, pNode -> xParent) ;
       if (pParent -> xChilds == pNode -> xNext)
           return 0 ;
       
  @@ -2799,7 +2822,7 @@
       if (pNode -> xPrev == pNode -> xNdx)
           return 0 ;
       
  -    pParent = Node_self (pDomTree, pNode -> xParent, nRepeatLevel) ;
  +    pParent = Node_self (pDomTree, pNode -> xParent) ;
       if (pParent -> xChilds == pNode -> xNdx)
           return 0 ;
       
  @@ -2911,7 +2934,6 @@
       if (pNode -> nType == ntypDocumentFraq)
        {
        int o        = pDomTree -> xNdx ;
  -     tAttrData * pOrderIndex = Element_selfGetAttribut (pDomTree, pNode, NULL, 
xOrderIndexAttr) ;
        pDomTree = DomTree_self (Element_selfGetAttribut (pDomTree, pNode, NULL, 
xDomTreeAttr) -> xValue) ;
           if (pCurrReq -> bDebug & dbgOutput)
            lprintf (r, "[%d]toString: ** Switch from DomTree=%d to new DomTree=%d\n", 
r -> nPid, o, pDomTree -> xNdx) ; 
  @@ -2927,170 +2949,172 @@
        if (pCurrReq -> bDebug & dbgOutput)
            lprintf (r, "[%d]toString: Node=%d(%d) RepeatLevel=%d type=%d flags=%x 
text=>%s<= (#%d) SVs=%d\n", r -> nPid, pNode -> xNdx, 
xNode_selfLevelNull(pDomTree,pNode), nRepeatLevel, pNode -> nType,  pNode -> bFlags, 
Ndx2String (pNode -> nText), pNode -> nText, sv_count) ; 
   
  -     if (pNode -> bFlags & nflgIgnore)
  -            ;
  -     else if (pNode -> nType == ntypDocumentFraq)
  +     if (pNode -> nType == ntypDocumentFraq)
            {
  -         Node_toString (r, pDomTree, pNode -> xNdx, nRepeatLevel) ; 
  +            Node_toString (r, pDomTree, pNode -> xNdx, 0) ; 
            }
  -        else if (pNode -> nType == ntypTag || pNode -> nType == ntypStartTag)
  -         {
  -         int n = pNode -> numAttr ;
  -         struct tAttrData * pAttr = (struct tAttrData *)(pNode + 1) ;
  -         char * pNodeName = Node_selfNodeName (pNode) ;
  -         char * pNodeStart ;
  -         char * pNodeEnd ;
  -         char * p ;
  -         int    nNodeStartLen ;
  -         int    nNodeEndLen ;
  -         int    nNodeNameLen ;
  -         int    nLastLen ;
  -         
  -         if (*pNodeName)
  -             {
  -             if (*pNodeName == ':')
  +     else
  +            {
  +            if (pNode -> bFlags & nflgIgnore)
  +                ;
  +            else if (pNode -> nType == ntypTag || pNode -> nType == ntypStartTag)
  +             {
  +             int n = pNode -> numAttr ;
  +             struct tAttrData * pAttr = (struct tAttrData *)(pNode + 1) ;
  +             char * pNodeName = Node_selfNodeName (pNode) ;
  +             char * pNodeStart ;
  +             char * pNodeEnd ;
  +             char * p ;
  +             int    nNodeStartLen ;
  +             int    nNodeEndLen ;
  +             int    nNodeNameLen ;
  +             int    nLastLen ;
  +             
  +             if (*pNodeName)
                    {
  -                 pNodeStart = ++pNodeName ;
  -                 nNodeStartLen = 0 ;
  -                 nNodeEndLen   = 0 ;
  -                 while (*pNodeName && *pNodeName != ':')
  -                     {
  -                     nNodeStartLen++ ;
  -                     pNodeName++ ;
  -                     }
                    if (*pNodeName == ':')
  -                     {
  -                     pNodeEnd = ++pNodeName ;
  -                     while (*pNodeName && *pNodeName != ':')
  +                     {
  +                     pNodeStart = ++pNodeName ;
  +                     nNodeStartLen = 0 ;
  +                     nNodeEndLen   = 0 ;
  +                     while (*pNodeName && *pNodeName != ':')
                            {
  -                         nNodeEndLen++ ;
  +                         nNodeStartLen++ ;
                            pNodeName++ ;
                            }
  -                     }
  -                 if (*pNodeName == ':')
  -                     pNodeName++ ;
  -                 
  -                 nNodeNameLen = 0 ;
  -                 p = pNodeName ;
  -                 while (*p && *p != ':')
  -                     {
  -                     p++ ;
  -                     nNodeNameLen++ ;
  -                     }
  -                 }
  -             else
  -                 {
  -                 pNodeStart = "<" ;
  -                 pNodeEnd = ">" ;
  -                 nNodeStartLen = 1 ;
  -                 nNodeEndLen = 1 ;
  -                 nNodeNameLen = strlen (pNodeName) ;
  -                 }
  -
  -             owrite (r, pNodeStart, nNodeStartLen) ;
  -             owrite (r, pNodeName, nNodeNameLen) ;
  -             if (*pNodeName)
  -                 nLastLen = 1 ;
  -             else
  -                 nLastLen = 0 ;
  -             
  -             while (n--)
  -                 {
  -                 if (pAttr -> bFlags)
  -                     {
  -                     char * s ;
  -                     int    l ;
  -                     if (nLastLen)
  -                         {                           
  -                         oputc (r, ' ') ;
  -                         nLastLen = 0 ;
  +                     if (*pNodeName == ':')
  +                         {
  +                         pNodeEnd = ++pNodeName ;
  +                         while (*pNodeName && *pNodeName != ':')
  +                             {
  +                             nNodeEndLen++ ;
  +                             pNodeName++ ;
  +                             }
                            }
  -                     if (pAttr -> xName != xNoName)
  +                     if (*pNodeName == ':')
  +                         pNodeName++ ;
  +                     
  +                     nNodeNameLen = 0 ;
  +                     p = pNodeName ;
  +                     while (*p && *p != ':')
                            {
  -                         Ndx2StringLen (pAttr -> xName,s,l) ;
  -                         owrite (r, s, l);
  -                         nLastLen += l ;
  +                         p++ ;
  +                         nNodeNameLen++ ;
                            }
  -
  -                     if (pAttr -> xValue)
  +                     }
  +                 else
  +                     {
  +                     pNodeStart = "<" ;
  +                     pNodeEnd = ">" ;
  +                     nNodeStartLen = 1 ;
  +                     nNodeEndLen = 1 ;
  +                     nNodeNameLen = strlen (pNodeName) ;
  +                     }
  +
  +                 owrite (r, pNodeStart, nNodeStartLen) ;
  +                 owrite (r, pNodeName, nNodeNameLen) ;
  +                 if (*pNodeName)
  +                     nLastLen = 1 ;
  +                 else
  +                     nLastLen = 0 ;
  +                 
  +                 while (n--)
  +                     {
  +                     if (pAttr -> bFlags)
                            {
  +                         char * s ;
  +                         int    l ;
  +                         if (nLastLen)
  +                             {                               
  +                             oputc (r, ' ') ;
  +                             nLastLen = 0 ;
  +                             }
                            if (pAttr -> xName != xNoName)
  -                             if (pAttr -> bFlags & aflgSingleQuote)
  -                                 oputs (r, "='") ;
  -                             else
  -                                 oputs (r, "=\"") ;
  -
  -                         if (pAttr -> bFlags & aflgAttrChilds)
  -                             {
  -                             tAttrData * pAttrNode = (tAttrData * )Node_toString2 
(r, pDomTree, pAttr -> xNdx, &nRepeatLevel) ;
  -                             if (pAttrNode && pAttrNode != pAttr)
  +                             {
  +                             Ndx2StringLen (pAttr -> xName,s,l) ;
  +                             owrite (r, s, l);
  +                             nLastLen += l ;
  +                             }
  +
  +                         if (pAttr -> xValue)
  +                             {
  +                             if (pAttr -> xName != xNoName)
  +                                 if (pAttr -> bFlags & aflgSingleQuote)
  +                                     oputs (r, "='") ;
  +                                 else
  +                                     oputs (r, "=\"") ;
  +
  +                             if (pAttr -> bFlags & aflgAttrChilds)
                                    {
  -                                 pAttr = pAttrNode ;
  -                                 pNode = Attr_selfNode(pAttr) ;
  -                                 n = pNode -> numAttr - Attr_selfAttrNum (pAttr) - 
1 ;
  -                                 if (n < 0)
  -                                     n = 0 ;
  +                                 tAttrData * pAttrNode = (tAttrData * 
)Node_toString2 (r, pDomTree, pAttr -> xNdx, &nRepeatLevel) ;
  +                                 if (pAttrNode && pAttrNode != pAttr)
  +                                     {
  +                                     pAttr = pAttrNode ;
  +                                     pNode = Attr_selfNode(pAttr) ;
  +                                     n = pNode -> numAttr - Attr_selfAttrNum 
(pAttr) - 1 ;
  +                                     if (n < 0)
  +                                         n = 0 ;
  +                                     }
  +                                 nLastLen++ ;
                                    }
  -                             nLastLen++ ;
  -                             }
  -                         else
  -                             {
  -                             Ndx2StringLen (pAttr -> xValue, s, l) ;
  -                             while (isspace (*s) && l > 0)
  -                                 s++, l-- ;
  -                             owrite (r, s, l) ;
  -                             nLastLen += l ;
  -                             }
  -                         if (pAttr -> xName != xNoName)
  -                             if (pAttr -> bFlags & aflgSingleQuote)
  -                                 oputc (r, '\'') ;
  -                             else
  -                                 oputc (r, '"') ;
  +                             else
  +                                 {
  +                                 Ndx2StringLen (pAttr -> xValue, s, l) ;
  +                                 while (isspace (*s) && l > 0)
  +                                     s++, l-- ;
  +                                 owrite (r, s, l) ;
  +                                 nLastLen += l ;
  +                                 }
  +                             if (pAttr -> xName != xNoName)
  +                                 if (pAttr -> bFlags & aflgSingleQuote)
  +                                     oputc (r, '\'') ;
  +                                 else
  +                                     oputc (r, '"') ;
  +                             }
                            }
  -                     }
  -                 pAttr++ ;
  +                     pAttr++ ;
  +                     }
  +                 owrite (r, pNodeEnd, nNodeEndLen) ;
                    }
  -             owrite (r, pNodeEnd, nNodeEndLen) ;
  -             }
  -         }
  -     else if (pNode -> nType == ntypText)
  -         {
  -         char * s ;
  -         int    l ;
  -         Ndx2StringLen (pNode -> nText,s,l) ;
  -         OutputEscape (r, s, l, (pNode -> bFlags & nflgEscUrl)?Char2Url:Char2Html, 
(pNode -> bFlags & nflgEscChar)?'\\':0) ;
  -         }
  -     else 
  -         {
  -         char * s ;
  -         int    l ;
  -         Ndx2StringLen (pNode -> nText,s,l) ;
  -         owrite (r, s, l);
  -         }
  -
  -     Node_toString2 (r, pDomTree, pNode -> xNdx, &nRepeatLevel) ;
  -
  -     if (pNode -> nType == ntypStartTag && (pNode -> bFlags & nflgIgnore) == 0)
  -         {
  -         char * pNodeName = Node_selfNodeName (pNode) ;
  +             }
  +         else if (pNode -> nType == ntypText)
  +             {
  +             char * s ;
  +             int    l ;
  +             Ndx2StringLen (pNode -> nText,s,l) ;
  +             OutputEscape (r, s, l, (pNode -> bFlags & 
nflgEscUrl)?Char2Url:Char2Html, (pNode -> bFlags & nflgEscChar)?'\\':0) ;
  +             }
  +         else 
  +             {
  +             char * s ;
  +             int    l ;
  +             Ndx2StringLen (pNode -> nText,s,l) ;
  +             owrite (r, s, l);
  +             }
  +
  +            Node_toString2 (r, pDomTree, pNode -> xNdx, &nRepeatLevel) ;
  +
  +         if (pNode -> nType == ntypStartTag && (pNode -> bFlags & nflgIgnore) == 0)
  +             {
  +             char * pNodeName = Node_selfNodeName (pNode) ;
       
  -         if (*pNodeName == ':')
  -             {
  -             int i = 4 ;
  -             while (i > 0 && *pNodeName)
  -                 if (*pNodeName++ == ':')
  -                     i-- ;
  -             if (*pNodeName)
  -                 oputs (r, pNodeName) ;
  -             }
  -         else
  -             {
  -             oputs (r, "</") ;
  -             oputs (r, Node_selfNodeName (pNode)) ;
  -             oputc (r, '>') ;
  -             }
  -         }
  -
  +             if (*pNodeName == ':')
  +                 {
  +                 int i = 4 ;
  +                 while (i > 0 && *pNodeName)
  +                     if (*pNodeName++ == ':')
  +                         i-- ;
  +                 if (*pNodeName)
  +                     oputs (r, pNodeName) ;
  +                 }
  +             else
  +                 {
  +                 oputs (r, "</") ;
  +                 oputs (r, Node_selfNodeName (pNode)) ;
  +                 oputc (r, '>') ;
  +                 }
  +             }
  +            }
   
        pLast   = pNode ;
        pNode  = Node_selfNextSibling (pDomTree, pNode, nRepeatLevel) ;
  
  
  
  1.4.2.39  +2 -6      embperl/Attic/epdom.h
  
  Index: epdom.h
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.h,v
  retrieving revision 1.4.2.38
  retrieving revision 1.4.2.39
  diff -u -r1.4.2.38 -r1.4.2.39
  --- epdom.h   2001/10/30 09:05:54     1.4.2.38
  +++ epdom.h   2001/10/30 14:40:15     1.4.2.39
  @@ -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.38 2001/10/30 09:05:54 richter Exp $
  +#   $Id: epdom.h,v 1.4.2.39 2001/10/30 14:40:15 richter Exp $
   #
   
###################################################################################*/
   
  @@ -240,11 +240,7 @@
   extern tIndex              xDocumentFraq ;        /* String index for Document 
Fraquent */
   extern tIndex              xOrderIndexAttr ;      /* String index for Attribute 
which holds the OrderIndex */
   
  -extern int nCheckpointCache ;
  -extern int nCheckpointCacheMask ;
  -extern tIndex xCheckpointCache[] ;
   
  -
   tStringIndex String2NdxInc (/*in*/ const char *          sText,
                            /*in*/ int              nLen,
                            /*in*/ int              bInc) ;
  @@ -520,5 +516,5 @@
                             /*out*/ char * *           ppAttr) ;
   
   
  -#define NodeAttr_selfParentNode(pDomTree,pNode,nLevel) (pNode->nType == 
ntypAttr?Attr_selfNode(((tAttrData 
*)pNode)):(Node_self(pDomTree,(pNode)->xParent,nLevel)))
  +#define NodeAttr_selfParentNode(pDomTree,pNode,nLevel) (pNode->nType == 
ntypAttr?Attr_selfNode(((tAttrData *)pNode)):(Node_self(pDomTree,(pNode)->xParent)))
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.18  +52 -2     embperl/Embperl/Syntax/Attic/EmbperlBlocks.pm
  
  Index: EmbperlBlocks.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/EmbperlBlocks.pm,v
  retrieving revision 1.1.2.17
  retrieving revision 1.1.2.18
  diff -u -r1.1.2.17 -r1.1.2.18
  --- EmbperlBlocks.pm  2001/08/28 08:01:28     1.1.2.17
  +++ EmbperlBlocks.pm  2001/10/30 14:40:16     1.1.2.18
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: EmbperlBlocks.pm,v 1.1.2.17 2001/08/28 08:01:28 richter Exp $
  +#   $Id: EmbperlBlocks.pm,v 1.1.2.18 2001/10/30 14:40:16 richter Exp $
   #
   ###################################################################################
    
  @@ -153,7 +153,36 @@
       return $tag ;
       }
   
  +# ---------------------------------------------------------------------------------
  +#
  +#   Add new block 
  +#
  +# ---------------------------------------------------------------------------------
  +
  +
  +sub AddMetaStartEnd 
  +
  +    {
  +    my ($self, $cmdname, $endname, $procinfostart) = @_ ;
  +
  +    my $tag ;
  +    my $pinfo ;
  +
  +    $tag = $self -> AddMetaCmd ($cmdname, $procinfostart) ;
  +    $tag -> {'nodetype'} = &ntypStartTag ;
  +
  +
  +    $tag = $self -> AddMetaCmd ($endname) ;
  +    $tag -> {'nodetype'} = &ntypEndTag ;
  +    $tag -> {'starttag'} = $cmdname ;
  +    
  +
  +    return $tag ;
  +    }
   
  +
  +    
  +
   # ---------------------------------------------------------------------------------
   #
   #   Add new simple html tag (override to add meta commands inside html tags)
  @@ -334,9 +363,10 @@
                   parsetimeperlcode => '$_[0] -> Syntax 
(HTML::Embperl::Syntax::GetSyntax(\'%%\', $_[0] -> SyntaxName)) ;', 
                   },
                   ) ;
  -    $self -> AddMetaCmdBlock ('sub', 'endsub',
  +    $self -> AddMetaStartEnd ('sub', 'endsub',
                   { 
                   perlcode => 'sub _ep_sub_%&<noname>% { ', 
  +                perlcodeend => '};  sub %^subname% { my @_ep_save ; 
HTML::Embperl::Cmd::SubStart($_ep_DomTree,%$q%,\\@_ep_save); my $_ep_ret = 
_ep_sub_%^subname% (@_); HTML::Embperl::Cmd::SubEnd($_ep_DomTree,\\@_ep_save); return 
$_ep_ret } ; $_[0] -> ExportHash -> {%^"subname%} = \&%^subname% ; ', 
                   removenode => 10,
                   mayjump     => 1,
                   stackname2   => 'subname',
  @@ -347,11 +377,31 @@
                   { 
                   perlcode => '};  sub %^subname% { my @_ep_save ; 
HTML::Embperl::Cmd::SubStart($_ep_DomTree,%$q%,\\@_ep_save); my $_ep_ret = 
_ep_sub_%^subname% (@_); HTML::Embperl::Cmd::SubEnd($_ep_DomTree,\\@_ep_save); return 
$_ep_ret } ; $_[0] -> ExportHash -> {%^"subname%} = \&%^subname% ; ', 
                   removenode => 10,
  +                mayjump     => 0,
  +                pop2        => 'subname',
  +                switchcodetype => 1,
  +                callreturn => 1,
  +                }) ;
  +=pod
  +    $self -> AddMetaStartEnd ('sub', 'endsub',
  +                { 
  +                perlcode => 'sub _ep_sub_%&<noname>% { ', 
  +                removenode => 10,
                   mayjump     => 1,
  +                stackname2   => 'subname',
  +                push2        => '%&<noname>%',
  +                switchcodetype => 2,
  +                callreturn => 1,
  +                },
  +                { 
  +                perlcode => '};  sub %^subname% { my @_ep_save ; 
HTML::Embperl::Cmd::SubStart($_ep_DomTree,%$q%,\\@_ep_save); my $_ep_ret = 
_ep_sub_%^subname% (@_); HTML::Embperl::Cmd::SubEnd($_ep_DomTree,\\@_ep_save); return 
$_ep_ret } ; $_[0] -> ExportHash -> {%^"subname%} = \&%^subname% ; ', 
  +                removenode => 10,
  +                mayjump     => 0,
                   pop2        => 'subname',
                   switchcodetype => 1,
                   callreturn => 1,
                   }) ;
  +=cut
       } 
   
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +10 -7     embperl/test/cmp/Attic/execprint.htm
  
  Index: execprint.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/cmp/Attic/execprint.htm,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- execprint.htm     2001/05/02 11:54:51     1.1.2.1
  +++ execprint.htm     2001/10/30 14:40:16     1.1.2.2
  @@ -1,25 +1,28 @@
   * <h1>head from foo</h1>
  -
   *without print...
   
    <h1>head from foo</h1>
  -
    <h1>head from foo</h1>
  -
    <h1>head from foo</h1>
  -
   without print...
   
   ### 1
    <h1>head from foo</h1>
  -
   ###
   ### 2
    <h1>head from foo</h1>
  -
   ###
   ### 3
    <h1>head from foo</h1>
  -
   ###
  +with print in different blocks ...
   
  +* 1 * <h1>head from foo</h1>
  +** 2 * <h1>head from foo</h1>
  +** 3 * <h1>head from foo</h1>
  +*with print...
  +
  +* 1 * <h1>head from foo</h1>
  +** 2 * <h1>head from foo</h1>
  +** 3 * <h1>head from foo</h1>
  +*
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +1 -2      embperl/test/html/Attic/execprint.htm
  
  Index: execprint.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/Attic/execprint.htm,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- execprint.htm     2001/05/02 11:54:56     1.1.2.1
  +++ execprint.htm     2001/10/30 14:40:16     1.1.2.2
  @@ -22,8 +22,8 @@
   ###
   [$endforeach$]
   
  -[#
   
  +
   with print in different blocks ...
   
   [$foreach $i (1..3) $]
  @@ -43,4 +43,3 @@
   -]
   [$endforeach$]
   
  -#]
  \ No newline at end of file
  
  
  
  1.4.6.3   +0 -17     embperl/test/html/subimp.pm
  
  Index: subimp.pm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/subimp.pm,v
  retrieving revision 1.4.6.2
  retrieving revision 1.4.6.3
  diff -u -r1.4.6.2 -r1.4.6.3
  --- subimp.pm 2001/06/25 03:30:11     1.4.6.2
  +++ subimp.pm 2001/10/30 14:40:16     1.4.6.3
  @@ -80,20 +80,3 @@
   [$endsub$]
   
   
  -[###### table header #####]
  -[$sub tabheader $]
  -
  -<table>
  -<tr><th>1</th><th>2></th></tr>
  -<tr>
  -
  -[$endsub$]
  -
  -
  -[###### table footer #####]
  -[$sub tabfooter $]
  -
  -</tr>
  -</table>
  -
  -[$endsub$]
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to