perl-embperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@locus.apache.org
Subject cvs commit: embperl/test/html loop.htm
Date Mon, 22 May 2000 14:37:40 GMT
richter     00/05/22 07:37:36

  Modified:    .        Tag: Embperl2 Embperl.xs epcomp.c epdom.c epdom.h
                        epmain.c test.pl
               Embperl  Tag: Embperl2 Syntax.pm
               test/html Tag: Embperl2 loop.htm
  Log:
  - Embperl 2, if & loops
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.26.2.5  +7 -0      embperl/Embperl.xs
  
  Index: Embperl.xs
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl.xs,v
  retrieving revision 1.26.2.4
  retrieving revision 1.26.2.5
  diff -u -r1.26.2.4 -r1.26.2.5
  --- Embperl.xs	2000/05/19 13:35:25	1.26.2.4
  +++ Embperl.xs	2000/05/22 14:37:09	1.26.2.5
  @@ -625,6 +625,13 @@
       Node_removeChild (DomTree_self (xDomTree), -1, xChild) ;
   
   
  +void
  +embperl_DomTree_checkpoint (xDomTree, xChild)
  +    int xDomTree
  +    int xChild
  +CODE:
  +    DomTree_checkpoint (xDomTree, xChild) ;
  +
   #void
   #Node_parentNode (xChild)
   #    int xChild
  
  
  
  1.1.2.9   +37 -12    embperl/Attic/epcomp.c
  
  Index: epcomp.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcomp.c,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- epcomp.c	2000/05/19 13:35:26	1.1.2.8
  +++ epcomp.c	2000/05/22 14:37:09	1.1.2.9
  @@ -181,7 +181,8 @@
   
   
   embperl_CompileNode (/*in*/  tDomTree *   pDomTree,
  -		     /*in*/ tNode	    xNode)
  +		     /*in*/ tNode	  xNode,
  +		     /*i/o*/ int *        bCheckpointPending)
   
   
       {
  @@ -221,27 +222,42 @@
   		        Node_selfRemoveChild(pDomTree, -1, pNextNode) ;
   	            }
   	        }
  -            if (pCmd -> bRemoveNode & 1)
  +            *bCheckpointPending = 1 ;
  +	    if (pCmd -> bRemoveNode & 1)
   	        Node_selfRemoveChild(pDomTree, -1, pNode) ;
               else if (pCmd -> bRemoveNode & 8)
  -	        pNode -> bFlags |= 8 ;
  +	        pNode -> bFlags |= nflgIgnore ;
               }
           }
       else
           pCmd = NULL ;
       
  +    if (*bCheckpointPending && pNode -> bFlags && (pNode -> bFlags
& nflgIgnore) == 0)
  +	{
  +	int l ;
  +	char buf [80] ;
  +	
  +	pNode -> bFlags |= nflgCheckpoint ;
  +	l = sprintf (buf, "_ep_cp($_ep_DomTree,%d) ;\n", pNode -> xNdx) ;
  +	StringAdd (&pProg, buf,  l) ; 
  +	*bCheckpointPending = 0 ;
  +	}
  +    
       xChildNode = pNode -> bFlags?Node_firstChild (pDomTree, xNode):0 ;
   
       while (xChildNode)
   	{
  -	embperl_CompileNode (pDomTree, xChildNode) ;
  +	embperl_CompileNode (pDomTree, xChildNode, bCheckpointPending) ;
   
   	xChildNode  = Node_nextSibling (pDomTree, xChildNode) ;
   	}
   
       if (pCmd)
  +	{
           embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sPerlCodeEnd) ;
  -
  +	if (pCmd -> sPerlCodeEnd)
  +	    *bCheckpointPending = 1 ;
  +	}
       }
   
   /* ------------------------------------------------------------------------ */
  @@ -264,6 +280,9 @@
       tDomTree *	pDomTree ;
       clock_t	cl1 = clock () ;
       clock_t	cl2  ;
  +    clock_t	cl3  ;
  +    clock_t	cl4  ;
  +    int         bCheckpointPending = 0 ;
   
       /* Already Parsed ? */
   
  @@ -283,34 +302,40 @@
   	if ((rc = ParseFile (r)) != ok)
   	    return rc ;
   
  +	cl2 = clock () ;
  +	
   	*ppSV = newSViv(r -> xCurrDomTree) ;
           SvREFCNT_inc (*ppSV) ;  
   	pDomTree = r -> pCurrDomTree ;
   
   	xNode = Node_firstChild (pDomTree, r -> xDocument) ;
   
  -	StringNew (&pProg, 8192) ;
  -	StringAdd (&pProg, "my $_ep_DomTree = $_[1];\n", 0) ;
  +	StringNew (&pProg, r -> Buf.pFile -> nFilesize / 4) ;
  +	StringAdd (&pProg, "my $_ep_DomTree = $_[1];\n*_ep_rp=\\&XML::Embperl::DOM::Node_replaceChildWithCDATA;\n*_ep_cp=\\&XML::Embperl::DOM::DomTree_checkpoint;\n
", 0) ;
       
   	while (xNode)
   	    {
  -	    embperl_CompileNode (pDomTree, xNode) ;
  +	    embperl_CompileNode (pDomTree, xNode, &bCheckpointPending) ;
   
   	    xNode  = Node_nextSibling (pDomTree, xNode) ;
   	    }
   
   	StringAdd (&pProg, "", 1) ; 
   
  +	cl3 = clock () ;
  +
   	if ((rc = EvalStore (r, pProg, 0, &pSV)) != ok)
   	    return rc ;
       
  -	cl2 = clock () ;
  +	cl4 = clock () ;
   #ifdef CLOCKS_PER_SEC
           if (r -> bDebug)
   	    {
  -	    lprintf (r, "[%d]PERF: Compile Start Time: %d ms \n", r -> nPid, ((cl1 - r ->
startclock) * 1000 / CLOCKS_PER_SEC)) ;
  -	    lprintf (r, "[%d]PERF: Compile End Time:   %d ms \n", r -> nPid, ((cl2 - r ->
startclock) * 1000 / CLOCKS_PER_SEC)) ;
  -	    lprintf (r, "[%d]PERF: Compile Time:       %d ms \n", r -> nPid, ((cl2 - cl1) *
1000 / CLOCKS_PER_SEC)) ;
  +	    lprintf (r, "[%d]PERF: Compile Start Time:	    %d ms \n", r -> nPid, ((cl1 - r
-> startclock) * 1000 / CLOCKS_PER_SEC)) ;
  +	    lprintf (r, "[%d]PERF: Parse End Time:	    %d ms \n", r -> nPid, ((cl2 - r ->
startclock) * 1000 / CLOCKS_PER_SEC)) ;
  +	    lprintf (r, "[%d]PERF: To Perl End Time:	    %d ms \n", r -> nPid, ((cl3 - r ->
startclock) * 1000 / CLOCKS_PER_SEC)) ;
  +	    lprintf (r, "[%d]PERF: Perl Compile End Time:   %d ms \n", r -> nPid, ((cl4 - r
-> startclock) * 1000 / CLOCKS_PER_SEC)) ;
  +	    lprintf (r, "[%d]PERF: Compile Time:	    %d ms \n", r -> nPid, ((cl4 - cl1) * 1000
/ CLOCKS_PER_SEC)) ;
   	    }
   #endif        
   	}
  
  
  
  1.1.2.14  +105 -21   embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.1.2.13
  retrieving revision 1.1.2.14
  diff -u -r1.1.2.13 -r1.1.2.14
  --- epdom.c	2000/05/19 13:35:26	1.1.2.13
  +++ epdom.c	2000/05/22 14:37:10	1.1.2.14
  @@ -338,6 +338,8 @@
       ArrayNew (&pDomTree -> pLookup, 128, sizeof (struct tNodeData *)) ; 
       ArrayAdd (&pDomTree -> pLookup, 1) ;
   
  +    ArrayNew (&pDomTree -> pOrder, 128, sizeof (tNode)) ; 
  +
       pDomTree -> xNdx = n ;
       pDomTree -> pLookup[0] = NULL ;
   
  @@ -348,7 +350,7 @@
   
   /* ------------------------------------------------------------------------ */
   /*                                                                          */
  -/* DomTree_new                                                              */
  +/* DomTree_clone                                                            */
   /*                                                                          */
   /*                                                                          */
   /*                                                                          */
  @@ -366,6 +368,7 @@
       pDomTree -> xNdx = n ;
   
       ArrayClone (pOrgDomTree, &pDomTree -> pLookup) ; 
  +    ArrayNew (&pDomTree -> pOrder, 128, sizeof (tNode)) ; 
   
       *pNewDomTree = pDomTree  ;
   
  @@ -373,6 +376,16 @@
       }
   
   
  +void DomTree_checkpoint (tIndex xDomTree, tNode xChild)
  +
  +
  +    {
  +    tDomTree * pDomTree = DomTree_self (xDomTree) ;
  +    int n = ArrayAdd (&pDomTree -> pOrder, 1) ;
  +    (pDomTree -> pOrder)[n] = xChild ;
  +    }
  +
  +
   
   int mydie (char *  msg)
       {
  @@ -623,7 +636,7 @@
   	pNew -> numAttr = 0 ;
   	pNew -> xNdx	= xNdx ;
   	pNew -> xChilds = 0 ;
  -	pNew -> bFlags  = 1 ;
  +	pNew -> bFlags  = nflgOK ;
   	pNew -> nPadOffset = pChilds -> nFill ;
   
   	pChilds -> numChilds++ ;
  @@ -659,7 +672,7 @@
       if (xNode != -1 && pPad -> xParent != xNode)
   	return 0 ;
   
  -    pChild -> bFlags = 0 ;
  +    pChild -> bFlags = nflgDeleted ;
       pPad   -> numChilds-- ;
   
       return xChild ;
  @@ -685,7 +698,7 @@
       if (xNode != -1 && pPad -> xParent != xNode)
   	return 0 ;
   
  -    pChild -> bFlags = 0 ;
  +    pChild -> bFlags = nflgDeleted ;
       pPad   -> numChilds-- ;
   
       return pChild ;
  @@ -715,8 +728,8 @@
       if (nEscMode != -1)
   	{
   	pOldChild -> nType  = (nEscMode & 3)?ntypText:ntypCDATA ;
  -	pOldChild -> bFlags &= ~6 ;
  -	pOldChild -> bFlags |= (~nEscMode) & 6 ;
  +	pOldChild -> bFlags &= ~(nflgEscUrl + nflgEscChar) ;
  +	pOldChild -> bFlags |= (~nEscMode) & (nflgEscUrl + nflgEscChar) ;
   	}
       else
   	pOldChild -> nType  = ntypCDATA ;
  @@ -744,12 +757,28 @@
       {
       struct tNodeData *	pNode = Node_self (pDomTree, xNode) ;
       struct tNodePad *	pPad	= (struct tNodePad * )(((tUInt8 *)pNode) - pNode -> nPadOffset)
;
  -    /* lprintf (pCurrReq, "[%d]PARSE: parentNode: %d -> %d\n", pCurrReq -> nPid,
xNode, pPad -> xParent) ; */
       return pPad -> xParent ;
       }
   
   /* ------------------------------------------------------------------------ */
   /*                                                                          */
  +/* Node_selfParentNode                                                      */
  +/*                                                                          */
  +/* Get parent node							    */
  +/*                                                                          */
  +/* ------------------------------------------------------------------------ */
  +
  +
  +tNodeData * Node_selfParentNode  (/*in*/  tDomTree *	pDomTree,
  +				  /*in*/  tNodeData *	pNode) 
  +
  +    {
  +    struct tNodePad *	pPad	= (struct tNodePad * )(((tUInt8 *)pNode) - pNode -> nPadOffset)
;
  +    return Node_self (pDomTree, pPad -> xParent) ;
  +    }
  +
  +/* ------------------------------------------------------------------------ */
  +/*                                                                          */
   /* Node_firstChild                                                          */
   /*                                                                          */
   /* Get first child node							    */
  @@ -773,7 +802,32 @@
       return pNode && pNode -> bFlags?pNode -> xNdx:0 ;
       }
   
  +/* ------------------------------------------------------------------------ */
  +/*                                                                          */
  +/* Node_selfFirstChild                                                          */
  +/*                                                                          */
  +/* Get first child node							    */
  +/*                                                                          */
  +/* ------------------------------------------------------------------------ */
  +
   
  +tNodeData * Node_selfFirstChild  (/*in*/  tDomTree *   pDomTree,
  +				  /*in*/  tNodeData *  pNode) 
  +
  +    {
  +    struct tNodePad *	pPad = NodePad_self (pDomTree, pNode -> xChilds) ;
  +    tNodeData * pChildNode ;
  +    if (pPad == NULL)
  +	return 0 ;
  +    
  +    pChildNode = ((tNodeData *)(pPad + 1)) ;
  +    if (!pChildNode -> bFlags)
  +	pChildNode = Node_selfNextSibling (pDomTree, pChildNode) ;
  +
  +    return pChildNode ;
  +    }
  +
  +
   /* ------------------------------------------------------------------------ */
   /*                                                                          */
   /* Node_selfNthChild (pNode, nChildNo) ;                                    */
  @@ -887,15 +941,34 @@
   
   
       {
  -    xNode = Node_firstChild (pDomTree, xNode) ;
  +    tNode xFirstNode = xNode ;
  +    tNode xNextNode ;
  +    int   nOrderNdx = 0 ;
  +    tNodeData * pNextNode ;
  +    struct tNodeData * pNode = Node_self (pDomTree, xNode) ;
  +    
  +    
  +    pNode = Node_selfFirstChild (pDomTree, pNode) ;
   
  -    while (xNode)
  +    while (pNode)
   	{
  -	struct tNodeData * pNode = Node_self (pDomTree, xNode) ;
  +	if (pNode -> bFlags & nflgCheckpoint)
  +	    {
  +	    if ((xNextNode = pDomTree -> pOrder[nOrderNdx]) != pNode -> xNdx)	
  +		{
  +		if (pCurrReq -> bDebug & dbgParse)
  +		    lprintf (r, "[%d]toString: Skip Node=%d type=%d flags=%x text=>%s<= (#%d)\n",
r, pNode -> xNdx, pNode -> nType,  pNode -> bFlags, Ndx2String (pNode -> nText),
pNode -> nText) ; 
  +		xNode = xNextNode ;
  +		pNode = Node_self (pDomTree, xNode) ;
  +		}
  +	    nOrderNdx++ ;
  +	    }
   
  -	lprintf (r, "[%d]toString: Node=%d type=%d flags=%x text=>%s<= (#%d)\n", r, xNode,
pNode -> nType,  pNode -> bFlags, Ndx2String (pNode -> nText), pNode -> nText)
; 
   
  -	if (pNode -> bFlags & 8)
  +	if (pCurrReq -> bDebug & dbgParse)
  +	    lprintf (r, "[%d]toString: Node=%d type=%d flags=%x text=>%s<= (#%d)\n", r,
pNode -> xNdx, pNode -> nType,  pNode -> bFlags, Ndx2String (pNode -> nText),
pNode -> nText) ; 
  +
  +	if (pNode -> bFlags & nflgIgnore)
               ;
           else if (pNode -> nType == ntypTag || pNode -> nType == ntypStartTag)
   	    {
  @@ -928,7 +1001,7 @@
   	    char * s ;
   	    int    l ;
   	    Ndx2StringLen (pNode -> nText,s,l) ;
  -	    OutputEscape (r, s, l, (pNode -> bFlags & 2)?Char2Url:Char2Html, (pNode ->
bFlags & 4)?'\\':0) ;
  +	    OutputEscape (r, s, l, (pNode -> bFlags & nflgEscUrl)?Char2Url:Char2Html, (pNode
-> bFlags & nflgEscChar)?'\\':0) ;
   	    }
   	else 
   	    {
  @@ -939,16 +1012,27 @@
   	    }
   
   	
  -	Node_toString (pDomTree, r, xNode) ;
  -
  -	if (pNode -> nType == ntypStartTag && (pNode -> bFlags & 8) == 0)
  +	pNextNode = Node_selfFirstChild (pDomTree, pNode) ;
  +	if (pNextNode == NULL)
   	    {
  -	    oputs (r, "</") ;
  -	    oputs (r, Node_selfNodeName (pNode)) ;
  -	    oputc (r, '>') ;
  +	    pNextNode  = Node_selfNextSibling (pDomTree, pNode) ;
  +	    while (pNextNode == NULL)
  +		{
  +		pNextNode = Node_selfParentNode (pDomTree, pNode) ;
  +		if (pNextNode == NULL || pNextNode -> xNdx == xFirstNode)
  +		    return ;
  +		    
  +		if (pNextNode -> nType == ntypStartTag && (pNextNode -> bFlags & nflgIgnore)
== 0)
  +		    {
  +		    oputs (r, "</") ;
  +		    oputs (r, Node_selfNodeName (pNextNode)) ;
  +		    oputc (r, '>') ;
  +		    }
  +		pNode = pNextNode ;
  +		pNextNode  = Node_selfNextSibling (pDomTree, pNextNode) ;
  +		}
   	    }
  -
  -	xNode  = Node_nextSibling (pDomTree, xNode) ;
  +	pNode = pNextNode ;
   	}
   
       }
  
  
  
  1.1.2.10  +18 -1     embperl/Attic/epdom.h
  
  Index: epdom.h
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.h,v
  retrieving revision 1.1.2.9
  retrieving revision 1.1.2.10
  diff -u -r1.1.2.9 -r1.1.2.10
  --- epdom.h	2000/05/19 13:35:26	1.1.2.9
  +++ epdom.h	2000/05/22 14:37:10	1.1.2.10
  @@ -115,10 +115,22 @@
       ntypCDATA	    = 4,
       } ;
   
  +enum tNodeFlags
  +    {
  +    nflgDeleted	    = 0,
  +    nflgOK	    = 1,
  +    nflgEscUrl      = 2,
  +    nflgEscChar	    = 4,
  +    nflgIgnore      = 8,
  +    nflgModified    = 16,
  +    nflgCheckpoint  = 32,
  +    } ;
   
  +
   struct tDomTree
       {
       void * *	pLookup ;	/* table for converting tNode, tNodePad and tAttr to pointers */
  +    tNode *     pOrder ;	/* Order of dom tree after execution of code */
       tIndex	xNdx ;		/* Index of Dom Tree */
       tNode	xDocument ;	/* root document node */
       } ;
  @@ -166,11 +178,16 @@
   tNode Node_parentNode  (/*in*/ tDomTree *  pDomTree,
   			/*in*/	tNode 		 xNode) ;
   
  +tNodeData * Node_selfParentNode  (/*in*/  tDomTree *	pDomTree,
  +				  /*in*/  tNodeData *	pNode) ;
   
   tNode Node_firstChild  (/*in*/ tDomTree *  pDomTree,
   			/*in*/	tNode 		 xNode) ;
  +
  +tNodeData * Node_selfFirstChild  (/*in*/  tDomTree *   pDomTree,
  +				  /*in*/  tNodeData *  pNode) ;
   
  -struct tNodeData * Node_selfNthChild (/*in*/ tDomTree *  pDomTree,
  +tNodeData * Node_selfNthChild (/*in*/ tDomTree *  pDomTree,
   				      /*in*/ struct tNodeData * pNode,
   				      /*in*/ int         nChildNo) ;
   
  
  
  
  1.65.2.5  +15 -3     embperl/epmain.c
  
  Index: epmain.c
  ===================================================================
  RCS file: /home/cvs/embperl/epmain.c,v
  retrieving revision 1.65.2.4
  retrieving revision 1.65.2.5
  diff -u -r1.65.2.4 -r1.65.2.5
  --- epmain.c	2000/05/18 07:45:00	1.65.2.4
  +++ epmain.c	2000/05/22 14:37:12	1.65.2.5
  @@ -2437,6 +2437,7 @@
   #endif
           {
   	#ifdef EP2
  +        oCommit (r, NULL) ;
   	Node_toString (r -> pCurrDomTree, r, r -> xDocument) ;
   	#endif
           oputs (r, "\r\n") ;
  @@ -2565,10 +2566,21 @@
       rc = embperl_CompileDocument (r) ;
   #else
           {
  -        clock_t cl = clock () ;
  -        lprintf (r, "[%d]PERF: Time: %d ms ", r -> nPid, ((cl - r -> startclock)
* 1000 / CLOCKS_PER_SEC)) ;
  -	}
  +        clock_t cl1 = clock () ;
  +        clock_t cl2  ;
  +
   	rc = EvalMain (r) ; 
  +	
  +	cl2 = clock () ;
  +#ifdef CLOCKS_PER_SEC
  +        if (r -> bDebug)
  +	    {
  +	    lprintf (r, "[%d]PERF: Run Start Time: %d ms \n", r -> nPid, ((cl1 - r -> startclock)
* 1000 / CLOCKS_PER_SEC)) ;
  +	    lprintf (r, "[%d]PERF: Run End Time:   %d ms \n", r -> nPid, ((cl2 - r -> startclock)
* 1000 / CLOCKS_PER_SEC)) ;
  +	    lprintf (r, "[%d]PERF: Run Time:       %d ms \n", r -> nPid, ((cl2 - cl1) * 1000
/ CLOCKS_PER_SEC)) ;
  +	    }
  +#endif    
  +        }
   #endif
   
       if ((r -> bOptions & optNoUncloseWarn) == 0)
  
  
  
  1.57.2.7  +8 -3      embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.57.2.6
  retrieving revision 1.57.2.7
  diff -u -r1.57.2.6 -r1.57.2.7
  --- test.pl	2000/05/19 13:35:26	1.57.2.6
  +++ test.pl	2000/05/22 14:37:12	1.57.2.7
  @@ -7,6 +7,10 @@
   ##    'input.htm?feld5=Wert5&feld6=Wert6&feld7=Wert7&feld8=Wert8&cb5=cbv5&cb6=cbv6&cb7=cbv7&cb8=cbv8&cb9=ncbv9&cb10=ncbv10&cb11=ncbv11&mult=Wert3&mult=Wert6&esc=a<b&escmult=a>b&escmult=Wert3',
   ##    'ascii',
   ##    'pure.htm',
  +##    'plainlong.htm',
  +##    'plainlong.htm',
  +##    'plainlong.htm',
  +##    'plainlong.htm',
   ##    'plain.htm',
   ##    'plain.htm',
   ##    'plain.htm',
  @@ -29,9 +33,10 @@
   ##    'spaces.htm',
   ##    'tagscan.htm',
   ##    'tagscan.htm??1',
  -    'if.htm',
  -    'ifperl.htm',
  +##    'if.htm',
  +##    'ifperl.htm',
       'loop.htm?erstes=Hallo&zweites=Leer+zeichen&drittes=%21%22%23%2a%2B&erstes=Wert2',
  +    'loop.htm?erstes=Hallo&zweites=Leer+zeichen&drittes=%21%22%23%2a%2B&erstes=Wert2',
       'loopperl.htm?erstes=Hallo&zweites=Leer+zeichen&drittes=%21%22%23&erstes=Wert2',
       'table.htm',
       'table.htm??1',
  @@ -140,7 +145,7 @@
       
   
       $defaultdebug = 0x1f85ffd ;
  -    #$defaultdebug = 1 ;
  +    $defaultdebug = 1 ;
   
       #### setup paths #####
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +32 -11    embperl/Embperl/Attic/Syntax.pm
  
  Index: Syntax.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/Syntax.pm,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- Syntax.pm	2000/05/19 13:35:30	1.1.2.2
  +++ Syntax.pm	2000/05/22 14:37:28	1.1.2.3
  @@ -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.2 2000/05/19 13:35:30 richter Exp $
  +#   $Id: Syntax.pm,v 1.1.2.3 2000/05/22 14:37:28 richter Exp $
   #
   ###################################################################################
   
  @@ -148,7 +148,7 @@
               embperl => { 
                   perlcode => 'if (%a0%) { ', 
                   perlcodeend => '}',
  -                removenode => 8,
  +                removenode => 10,
                   }
               },
            },
  @@ -161,7 +161,7 @@
               embperl => { 
                   perlcode => 'else {',
                   perlcodeend => '}',
  -                removenode => 8,
  +                removenode => 10,
                   }
               },
            },
  @@ -170,29 +170,38 @@
           'nodetype'   => ntypEndTag, 
           'unescape' => 1,
           'procinfo' => {
  -            embperl => { perlcode => '}' }
  +            embperl => { 
  +                perlcode => '}', 
  +                removenode => 10,
  +                },
               },
            },
       'elsif' => {
  -        'text' => 'elseif',
  +        'text' => 'elsif',
           'nodetype'   => ntypEndStartTag, 
  +        'cdatatype'  => ntypAttrValue,
           'unescape' => 1,
           'endtag'   => 'endif',
           'procinfo' => {
               embperl => { 
  -                perlcode => 'elsif (%#0%) { ', 
  +                perlcode => 'elsif (%a0%) { ', 
                   perlcodeend => '}',
  -                removenode => 8,
  +                removenode => 10,
                   }
               },
            },
       'while' => {
           'text' => 'while',
           'nodetype'   => ntypStartTag, 
  +        'cdatatype'  => ntypAttrValue,
           'unescape' => 1,
           'endtag'   => 'endwhile',
           'procinfo' => {
  -            embperl => { perlcode => 'while (%#0%) { ' }
  +            embperl => { 
  +                perlcode => 'while (%a0%) { ', 
  +                perlcodeend => '}',
  +                removenode => 10,
  +                }
               },
            },
       'endwhile' => {
  @@ -206,10 +215,15 @@
       'foreach' => {
           'text' => 'foreach',
           'nodetype'   => ntypStartTag, 
  +        'cdatatype'  => ntypAttrValue,
           'unescape' => 1,
           'endtag'   => 'endforeach',
           'procinfo' => {
  -            embperl => { perlcode => 'foreach (%#0%) { ' }
  +            embperl => { 
  +                perlcode => 'foreach %a0% { ', 
  +                perlcodeend => '}',
  +                removenode => 10,
  +                }
               },
            },
       'endforeach' => {
  @@ -226,12 +240,17 @@
           'unescape' => 1,
           'endtag'   => 'until',
           'procinfo' => {
  -            embperl => { perlcode => 'do { ' }
  +            embperl => { 
  +                perlcode => 'do { ', 
  +                perlcodeend => '} until (1) ; ',
  +                removenode => 10,
  +                }
               },
            },
       'until' => {
           'text' => 'until',
           'nodetype'   => ntypEndTag, 
  +        'cdatatype'  => ntypAttrValue,
           'unescape' => 1,
           'procinfo' => {
               embperl => { perlcode => '} until (%#0%) ; ' }
  @@ -257,7 +276,9 @@
           'unescape' => 1,
           'procinfo' => {
               embperl => { 
  -                    perlcode => 'XML::Embperl::DOM::Node_replaceChildWithCDATA (%$n%,
scalar (do { %#0% })) ; ', 
  +#                    perlcode => 'push @a, 300, 500, do { %#0% } ; ', #  do XML::Embperl::DOM::Node_replaceChildWithCDATA
(%$n%, scalar (do { %#0% })) ; ', 
  +#                    perlcode => 'XML::Embperl::DOM::Node_replaceChildWithCDATA (%$n%,
scalar (do { %#0% })) ; ', 
  +                    perlcode => '_ep_rp(%$n%,scalar(do{%#0%}));', 
                       removenode  => 4,
                       }
               },
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +2 -2      embperl/test/html/loop.htm
  
  Index: loop.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/loop.htm,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- loop.htm	1999/10/05 06:03:45	1.4
  +++ loop.htm	2000/05/22 14:37:35	1.4.2.1
  @@ -42,7 +42,7 @@
   	[- $i++ -]
   [$ until $i > $#a $]
   
  -[$ foreach $v @a $]
  +[$ foreach $v (@a) $]
   	[+ $v +] <br>
   [$ endforeach $]
   
  @@ -66,7 +66,7 @@
   		[$ foreach $fv (1, 3, 5, 7, 9) $]
   			[+ $fv +] <br>
   		[$ endforeach $]
  -		[$ foreach $fv () $]
  +		[$ foreach $fv (()) $]
   			[+ $fv +] <br>
   			[$ while ($wv, $wk) = each (%h) $]
   				[+ "$wv = $wk" +]<br>
  
  
  

Mime
View raw message