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 input.htm table.htm
Date Mon, 29 May 2000 14:23:46 GMT
richter     00/05/29 07:23:45

  Modified:    .        Tag: Embperl2 epcomp.c epdom.c epdom.h eputil.c
                        test.pl
               Embperl  Tag: Embperl2 Syntax.pm
               test/cmp Tag: Embperl2 error.htm
               test/html Tag: Embperl2 input.htm table.htm
  Log:
  Embperl 2 - Input & Tables
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.17  +244 -92   embperl/Attic/epcomp.c
  
  Index: epcomp.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcomp.c,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- epcomp.c	2000/05/29 07:34:29	1.1.2.16
  +++ epcomp.c	2000/05/29 14:22:08	1.1.2.17
  @@ -19,6 +19,9 @@
       {
       const char * *  sPerlCode ;
       const char *    sPerlCodeEnd ;
  +    const char *    sStackName ;
  +    const char *    sPushStack ;
  +    int             bPopStack ;
       int		    numPerlCode ;
       int		    bRemoveNode ;
       int		    bMayJump ;
  @@ -26,7 +29,6 @@
   
   typedef struct tEmbperlCmd tEmbperlCmd ;
   
  -char * pCode = NULL ;
   char * pProg = NULL ;
   
   tStringIndex nMaxEmbperlCmd ;
  @@ -106,8 +108,11 @@
           }
       
       pEmbperlCmds[nNodeName].sPerlCodeEnd = GetHashValueStr (pHash, "perlcodeend", NULL)
;
  +    pEmbperlCmds[nNodeName].sStackName   = GetHashValueStr (pHash, "stackname", NULL) ;
  +    pEmbperlCmds[nNodeName].sPushStack   = GetHashValueStr (pHash, "push", NULL) ;
       pEmbperlCmds[nNodeName].bRemoveNode  = GetHashValueInt (pHash, "removenode", 0) ;
       pEmbperlCmds[nNodeName].bMayJump     = GetHashValueInt (pHash, "mayjump", 0) ;
  +    pEmbperlCmds[nNodeName].bPopStack    = GetHashValueInt (pHash, "pop", 0) ;
   
   
       if (r -> bDebug & dbgParse)
  @@ -139,37 +144,34 @@
       }
   
   
  -
   /* ------------------------------------------------------------------------ */
   /*                                                                          */
  -/* embperl_CompileAddChildNode                                              */
  +/* embperl_CompileAddValue                                                  */
   /*                                                                          */
  -/* Add value of child node to perl code                                     */
  +/* Add value to perl code                                                   */
   /*                                                                          */
   /* ------------------------------------------------------------------------ */
   
   
  -int embperl_CompileAddChildNode (/*in*/ tDomTree *   pDomTree,
  -    		                 /*in*/ tNodeData *	 pNode,
  +static int embperl_CompileAddValue    (/*in*/  const char * sText,
   				        const char * p,
   					const char * q,
  +                                        const char * eq, 
   					char op,
  -					char out)
  +					char out,
  +                                       /*i/o*/  char * *      ppCode )
  +
   
   
   
       {
       const char * or ;
  -    const char * eq = strchr (p, ':') ;
  -    const char * e = eq && eq < q?eq:q;
  -    int nChildNo = atoi (p) ;
  -    struct tNodeData * pChildNode = Node_selfNthChild (pDomTree, pNode, nChildNo) ;
  -    const char * sText ;
  +    const char * e ;
  +
       
  -    if (pChildNode)
  +    if (sText)
   	{
  -	sText = Node_selfNodeName(pChildNode) ;
  -	if (op == '=' && eq)
  +        if (op == '=' && eq)
   	    {
   	    eq++ ;
   	    do
  @@ -199,47 +201,187 @@
   		}
   	    while (or) ;
   	    }
  -	else if (op == '!' && pChildNode)
  +	else if (op == '!' && sText)
   	    {
   	    return 0 ;
   	    }
  -	}
  +
  +        if (out)
  +            StringAdd (ppCode, sText, 0) ;
  +        }
       else
  -	if (op != '!')
  +        {
  +        if (op != '!')
   	    return 0 ;
  +        }
  +
  +    return 1 ;
  +    }
  +
   
  -    if (pChildNode && out)
  -	StringAdd (&pCode, sText, 0) ;
  +/* ------------------------------------------------------------------------ */
  +/*                                                                          */
  +/* embperl_CompilePushStack                                                 */
  +/*                                                                          */
  +/* Add value of child node to perl code                                     */
  +/*                                                                          */
  +/* ------------------------------------------------------------------------ */
  +
  +
  +static void embperl_CompilePushStack    (/*in*/ tDomTree *   pDomTree,
  +				              const char * sStackName,
  +				              const char * sStackValue)
  +                                              
  +    {
  +    SV **   ppSV ;
  +    SV *    pSV ;
  +    AV *    pAV ;
  +
  +    ppSV = hv_fetch((HV *)(pDomTree -> pSV), (char *)sStackName, strlen (sStackName),
1) ;  
  +    if (ppSV == NULL)
  +        return  ;
  +
  +    if (*ppSV == NULL || SvTYPE (*ppSV) != SVt_RV)
  +        *ppSV = newRV_noinc ((SV *)(pAV = newAV ())) ;
       else
  -	; // mydie ("missing child") ;			    
  +        pAV = (AV *)SvRV (*ppSV) ;
  +        
  +        
  +    pSV = newSVpv ((char *)sStackValue, strlen (sStackValue)) ;
  +    SvUPGRADE (pSV, SVt_PVIV) ;
  +    SvIVX (pSV) = 0 ;
  +    av_push (pAV, pSV) ;
  +    }
   
  -    return 1 ;
  +
  +/* ------------------------------------------------------------------------ */
  +/*                                                                          */
  +/* embperl_CompilePopStack                                                  */
  +/*                                                                          */
  +/* Add value of child node to perl code                                     */
  +/*                                                                          */
  +/* ------------------------------------------------------------------------ */
  +
  +
  +static void embperl_CompilePopStack    (/*in*/ tDomTree *   pDomTree,
  +				              const char * sStackName)
  +                                              
  +    {
  +    SV **   ppSV ;
  +    SV *    pSV ;
  +
  +    ppSV = hv_fetch((HV *)(pDomTree -> pSV), (char *)sStackName, strlen (sStackName),
0) ;  
  +    if (ppSV == NULL || *ppSV == NULL || SvTYPE (*ppSV) != SVt_RV)
  +        return  ;
  +
  +    av_pop ((AV *)SvRV (*ppSV)) ;
       }
   
   /* ------------------------------------------------------------------------ */
   /*                                                                          */
  -/* embperl_CompileAddAttribut                                               */
  +/* embperl_CompileAddStack                                                  */
  +/*                                                                          */
  +/* Add value of child node to perl code                                     */
  +/*                                                                          */
  +/* ------------------------------------------------------------------------ */
  +
  +
  +static int embperl_CompileAddStack    (/*in*/ tDomTree *   pDomTree,
  +				                const char * p,
  +					        const char * q,
  +					        char op,
  +					        char out,
  +                                                char str,
  +                                       /*i/o*/  char * *      ppCode )
  +    {
  +    const char * eq = strchr (p, ':') ;
  +    const char * e = eq && eq < q?eq:q;
  +    IV           l ;
  +    const char * sText = NULL ;
  +    SV **   ppSV ;
  +    AV *    pAV ;
  +
  +
  +    ppSV = hv_fetch((HV *)(pDomTree -> pSV), (char *)p, e - p, 0) ;  
  +    if (ppSV == NULL || *ppSV == NULL || SvTYPE (*ppSV) != SVt_RV)
  +        return  op == '!'?1:0 ;
  +
  +    pAV = (AV *)SvRV (*ppSV) ;
  +
  +    if (SvTYPE (pAV) != SVt_PVAV)
  +        return  op == '!'?1:0 ;
  +    
  +    ppSV = av_fetch (pAV, av_len (pAV), 0) ;
  +    if (ppSV == NULL || *ppSV == NULL)
  +        return  op == '!'?1:0 ;
  +
  +    if (str)
  +        {
  +        sText = SvPV (*ppSV, l) ;    
  +        (SvIVX (*ppSV))++ ;
  +        }
  +    else
  +        sText = SvIVX (*ppSV)?"1":NULL ;
  +
  +
  +    return embperl_CompileAddValue (sText, p, q, eq, op, out, ppCode) ;
  +    }
  +
  +/* ------------------------------------------------------------------------ */
   /*                                                                          */
  +/* embperl_CompileAddChildNode                                              */
  +/*                                                                          */
   /* Add value of child node to perl code                                     */
   /*                                                                          */
   /* ------------------------------------------------------------------------ */
   
   
  -int embperl_CompileAddAttribut (/*in*/ tDomTree *   pDomTree,
  +static int embperl_CompileAddChildNode (/*in*/ tDomTree *   pDomTree,
       		                 /*in*/ tNodeData *	 pNode,
   				        const char * p,
   					const char * q,
   					char op,
  -					char out)
  +					char out,
  +                                       /*i/o*/  char * *      ppCode )
   
   
   
       {
  -    const char * or ;
       const char * eq = strchr (p, ':') ;
  +    int nChildNo = atoi (p) ;
  +    struct tNodeData * pChildNode = Node_selfNthChild (pDomTree, pNode, nChildNo) ;
  +    const char * sText = NULL ;
  +    
  +    if (pChildNode)
  +	sText = Node_selfNodeName(pChildNode) ;
  +
  +    return embperl_CompileAddValue (sText, p, q, eq, op, out, ppCode) ;
  +    }
  +
  +/* ------------------------------------------------------------------------ */
  +/*                                                                          */
  +/* embperl_CompileAddAttribut                                               */
  +/*                                                                          */
  +/* Add value of child node to perl code                                     */
  +/*                                                                          */
  +/* ------------------------------------------------------------------------ */
  +
  +
  +static int embperl_CompileAddAttribut (/*in*/   tDomTree *   pDomTree,
  +    		                       /*in*/   tNodeData *	 pNode,
  +				                const char * p,
  +					        const char * q,
  +					        char op,
  +					        char out,
  +                                       /*i/o*/  char * *      ppCode )
  +
  +
  +
  +    {
  +    const char * eq = strchr (p, ':') ;
       const char * e = eq && eq < q?eq:q;
       tAttrData * pChildNode = Element_selfGetAttribut (pDomTree, pNode, p, e - p) ;
  -    const char * sText ;
  +    const char * sText = NULL ;
   
       
       if (pChildNode)
  @@ -248,53 +390,10 @@
   	    sText = Node_selfNodeName (Node_selfFirstChild (pDomTree, (tNodeData *)pChildNode))
;
   	else
   	    sText = Ndx2String (pChildNode -> xValue) ;
  -	if (op == '=' && eq)
  -	    {
  -	    eq++ ;
  -	    do
  -		{
  -		or = strchr (eq + 1, '|') ;
  -		e = or?or - 1:q - 1 ;
  -		if (strncmp (sText, eq, e - eq) == 0)
  -		    break ;
  -		if (or == NULL)
  -		    return 0 ;
  -		eq = or + 1 ;
  -		}
  -	    while (or) ;
  -	    }
  -	else if (op == '~' && eq)
  -	    {
  -	    eq++ ;
  -	    do 
  -		{
  -		or = strchr (eq + 1, '|') ;
  -		e = or?or - 1:q - 1 ;
  -		if (strstrn (sText, eq, e - eq))
  -		    break ;
  -		if (or == NULL)
  -		    return 0 ;
  -		eq = or + 1 ;
  -		}
  -	    while (or) ;
  -	    }
  -	else if (op == '!' && pChildNode)
  -	    {
  -	    return 0 ;
  -	    }
  -	}
  -    else
  -	if (op != '!')
  -	    return 0 ;
   
  -    if (pChildNode && out && pChildNode -> xValue != 0)
  -	{
  -        StringAdd (&pCode, sText, 0) ;
  -	}
  -    else
  -	; // mydie ("missing child") ;			    
  -
  -    return 1 ;
  +        }
  +    
  +    return embperl_CompileAddValue (sText, p, q, eq, op, out, ppCode) ;
       }
   
   /* ------------------------------------------------------------------------ */
  @@ -306,9 +405,10 @@
   /* ------------------------------------------------------------------------ */
   
   
  -int embperl_CompileToPerlCode (/*in*/ tDomTree *   pDomTree,
  -    		               /*in*/ tNodeData *	 pNode,
  -                               /*in*/ const char *  sPerlCode)
  +static int embperl_CompileToPerlCode  (/*in*/ tDomTree *    pDomTree,
  +    		                       /*in*/ tNodeData *   pNode,
  +                                       /*in*/ const char *  sPerlCode,
  +                                       /*out*/ char * *     ppCode )
   
   
       {
  @@ -316,15 +416,15 @@
       const char * q ;
       int    valid = 1 ;
   
  +    StringNew (ppCode, 512) ;
       if (sPerlCode)
   	{
  -	StringNew (&pCode, 512) ;
   	p = strchr (sPerlCode, '%') ;	
   	while (p)
   	    {
   	    int n = p - sPerlCode ;
   	    if (n)
  -		StringAdd (&pCode, sPerlCode, n) ;
  +		StringAdd (ppCode, sPerlCode, n) ;
   	    q = strchr (p+1, '%') ;	
   	    if (q)
   		{
  @@ -347,27 +447,43 @@
   		
   		if (type == '#')
   		    {
  -		    if (!embperl_CompileAddChildNode (pDomTree, pNode ,p, q, op, out))
  +		    if (!embperl_CompileAddChildNode (pDomTree, pNode ,p, q, op, out, ppCode))
   			{
   			valid = 0 ;
   			break ;
   			}
   		    }
   		else if (type == '&')
  +		    {
  +		    if (!embperl_CompileAddAttribut (pDomTree, pNode ,p, q, op, out, ppCode))
  +			{
  +			valid = 0 ;
  +			break ;
  +			}
  +		    }
  +		else if (type == '^')
   		    {
  -		    if (!embperl_CompileAddAttribut (pDomTree, pNode ,p, q, op, out))
  +		    if (!embperl_CompileAddStack (pDomTree, p, q, op, out, 1, ppCode))
   			{
   			valid = 0 ;
   			break ;
   			}
   		    }
  +		else if (type == '?')
  +		    {
  +		    if (!embperl_CompileAddStack (pDomTree, p, q, op, out, 0, ppCode))
  +			{
  +			valid = 0 ;
  +			break ;
  +			}
  +		    }
   		else if (type == '$')
   		    {
   		    if (*p == 'n')
   			{
   			char s [20] ;
   			int  l = sprintf (s, "$_ep_DomTree,%u", pNode -> xNdx) ;
  -			StringAdd (&pCode, s, l) ; 
  +			StringAdd (ppCode, s, l) ; 
   			}
   		    }
   
  @@ -381,13 +497,7 @@
   		}
   	    }
   	if (valid)
  -	    {
  -	    int l = ArrayGetSize (pCode) ;
  -            if (l)
  -                StringAdd (&pProg, pCode, l) ;
  -	    StringAdd (&pProg, sPerlCode,  0) ; 
  -	    StringAdd (&pProg, "\n",  1) ; 
  -	    }
  +	    StringAdd (ppCode, sPerlCode,  0) ; 
   	}
       return valid ;
       }
  @@ -414,6 +524,9 @@
       tNodeData *     pNode = Node_self (pDomTree, xNode) ;
       tAttrData *     pAttr ;
       int             nAttr = 0 ;
  +    char *          pCode = NULL ; 
  +    char *          sStackValue = NULL ;
  +               
   
       if (*bCheckpointPending && (pNode -> nType == ntypText || pNode -> nType
== ntypCDATA) && pNode -> bFlags && (pNode -> bFlags & nflgIgnore)
== 0)
   	{
  @@ -453,8 +566,17 @@
   
               for (i = 0; i < pCmd -> numPerlCode; i++)
                   {
  -                if (embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sPerlCode[i]))
  +                if (embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sPerlCode[i],
&pCode))
  +                    {
  +                    if (pCode)
  +                        {
  +	                int l = ArrayGetSize (pCode) ;
  +                        if (l)
  +                            StringAdd (&pProg, pCode, l) ;
  +	                StringAdd (&pProg, "\n",  1) ; 
  +	                }
                       break ;
  +                    }
                   }
   
               if (pCmd -> bRemoveNode & 6)
  @@ -488,6 +610,15 @@
   	        Node_selfRemoveChild(pDomTree, -1, pNode) ;
               else if (pCmd -> bRemoveNode & 8)
   	        pNode -> bFlags |= nflgIgnore ;
  +
  +            if (pCmd -> sStackName && pCmd -> sPushStack)
  +                {
  +                if (embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sPushStack,
&sStackValue))
  +	            {
  +                    embperl_CompilePushStack (pDomTree, pCmd -> sStackName, sStackValue)
;
  +	            }
  +
  +                }
               }
           }
       else
  @@ -516,10 +647,26 @@
   
       if (pCmd)
   	{
  -        embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sPerlCodeEnd) ;
  +        if (embperl_CompileToPerlCode (pDomTree, pNode, pCmd -> sPerlCodeEnd, &pCode))
  +            {
  +            if (pCode)
  +                {
  +                int l = ArrayGetSize (pCode) ;
  +                if (l)
  +                    StringAdd (&pProg, pCode, l) ;
  +	        StringAdd (&pProg, "\n",  1) ; 
  +                }
  +            }
   	if (pCmd -> sPerlCodeEnd && pCmd -> bMayJump)
   	    *bCheckpointPending = 1 ;
  +        if (pCmd -> sStackName && pCmd -> sPushStack)
  +            {
  +            embperl_CompilePopStack (pDomTree, pCmd -> sStackName) ;
  +            }
   	}
  +
  +    StringFree (&sStackValue) ;
  +    StringFree (&pCode) ;
       }
   
   /* ------------------------------------------------------------------------ */
  @@ -574,15 +721,20 @@
   
   	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) ;
  -    
  +
  +        pDomTree -> pSV = (SV *)newHV () ;
  +
   	while (xNode)
   	    {
   	    embperl_CompileNode (pDomTree, xNode, &bCheckpointPending) ;
   
   	    xNode  = Node_nextSibling (pDomTree, xNode) ;
   	    }
  +
  +        SvREFCNT_dec (pDomTree -> pSV) ;
  +        pDomTree -> pSV = NULL ;
   
  -	StringAdd (&pProg, "", 1) ; 
  +        StringAdd (&pProg, "", 1) ; 
   
   	cl3 = clock () ;
   
  
  
  
  1.1.2.21  +45 -0     embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.1.2.20
  retrieving revision 1.1.2.21
  diff -u -r1.1.2.20 -r1.1.2.21
  --- epdom.c	2000/05/29 07:34:30	1.1.2.20
  +++ epdom.c	2000/05/29 14:22:08	1.1.2.21
  @@ -32,6 +32,7 @@
   tIndex xNoName = 0 ;
   
   #define dom_malloc(s)  (nMemUsage += s, malloc(s))
  +#define dom_free(s)    (free(s))
   
   /* ------------------------------------------------------------------------ */
   /*                                                                          */
  @@ -64,6 +65,28 @@
   
   /* ------------------------------------------------------------------------ */
   /*                                                                          */
  +/* ArrayFree                                                                */
  +/*                                                                          */
  +/* Create a new dynamic array                                               */
  +/*                                                                          */
  +/* ------------------------------------------------------------------------ */
  +
  +int ArrayFree (/*in*/ const tArray * pArray)
  +
  +
  +    {
  +    struct tArrayCtrl * pCtrl = ((struct tArrayCtrl *)(*(void * *)pArray)) - 1 ;
  +
  +    if (pCtrl)
  +        dom_free (pCtrl) ;
  +
  +    (*(void * *)pArray) = NULL ;
  +
  +    return ok ;
  +    }
  +
  +/* ------------------------------------------------------------------------ */
  +/*                                                                          */
   /* ArrayClone                                                               */
   /*                                                                          */
   /* Create a new dynamic array as exact copy of old one                      */
  @@ -228,7 +251,24 @@
   	ArraySetSize (pArray, 0);
       }
   
  +/* ------------------------------------------------------------------------ */
  +/*                                                                          */
  +/* StringFree                                                               */
  +/*                                                                          */
  +/* Free String memory                                                       */
  +/*                                                                          */
  +/* ------------------------------------------------------------------------ */
  +
   
  +void StringFree (/*in*/ char * * pArray)
  +	         
  +
  +    {	      
  +    if ((*(void * *)pArray) != NULL)
  +	ArrayFree (pArray) ;
  +    }
  +
  +
   /* ------------------------------------------------------------------------ */
   /*                                                                          */
   /* StringAdd                                                                */
  @@ -369,6 +409,7 @@
   
       pDomTree -> xNdx = n ;
       pDomTree -> pLookup[0] = NULL ;
  +    pDomTree -> pSV = NULL ;
   
       *pNewLookup = pDomTree  ;
   
  @@ -397,6 +438,10 @@
       ArrayClone (pOrgDomTree, &pDomTree -> pLookup) ; 
       ArrayNew (&pDomTree -> pOrder, 128, sizeof (tNode)) ; 
   
  +    if (pDomTree -> pSV = pOrgDomTree -> pSV)
  +        SvREFCNT_inc (pDomTree -> pSV) ;
  +
  +    
       *pNewDomTree = pDomTree  ;
   
       return n ;
  
  
  
  1.1.2.17  +12 -0     embperl/Attic/epdom.h
  
  Index: epdom.h
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.h,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- epdom.h	2000/05/29 07:34:30	1.1.2.16
  +++ epdom.h	2000/05/29 14:22:10	1.1.2.17
  @@ -142,6 +142,7 @@
       tNode *     pOrder ;	/* Order of dom tree after execution of code */
       tIndex	xNdx ;		/* Index of Dom Tree */
       tNode	xDocument ;	/* root document node */
  +    SV *        pSV ;
       } ;
   
   typedef struct tDomTree tDomTree ;
  @@ -169,6 +170,8 @@
   	      /*in*/ int	nAdd,
   	      /*in*/ int	nElementSize) ;
   
  +int ArrayFree (/*in*/ const tArray * pArray) ;
  +
   int ArraySet (/*in*/ const tArray * pArray,
   	      /*in*/ int	numElements) ;
   
  @@ -176,6 +179,15 @@
   	          /*in*/ int	numElements) ;
   
   int ArrayGetSize (/*in*/ const tArray * pArray) ;
  +
  +void StringNew (/*in*/ char * * pArray,
  +	      /*in*/ int	nAdd) ;
  +
  +void StringFree (/*in*/ char * * pArray) ;
  +
  +void StringAdd (/*in*/ char * *	   pArray,
  +	       /*in*/ const char * sAdd,
  +	       /*in*/ int 	   nLen) ;
   
   
   
  
  
  
  1.14.2.3  +15 -0     embperl/eputil.c
  
  Index: eputil.c
  ===================================================================
  RCS file: /home/cvs/embperl/eputil.c,v
  retrieving revision 1.14.2.2
  retrieving revision 1.14.2.3
  diff -u -r1.14.2.2 -r1.14.2.3
  --- eputil.c	2000/05/23 16:00:51	1.14.2.2
  +++ eputil.c	2000/05/29 14:22:10	1.14.2.3
  @@ -576,6 +576,21 @@
       }
   
   
  +
  +void SetHashValueStr   (/*in*/  HV *           pHash,
  +                        /*in*/  const char *   sKey,
  +                        /*in*/  char *         sValue)
  +
  +    {
  +    SV *   pSV = newSVpv (sValue, 0) ;
  +
  +    /*EPENTRY (GetHashValueInt) ;*/
  +
  +    hv_store(pHash, (char *)sKey, strlen (sKey), pSV, 0) ;  
  +    }
  +
  +
  +
   /* ------------------------------------------------------------------------- */
   /*                                                                           */
   /* GetLineNo								     */
  
  
  
  1.57.2.13 +4 -4      embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.57.2.12
  retrieving revision 1.57.2.13
  diff -u -r1.57.2.12 -r1.57.2.13
  --- test.pl	2000/05/24 21:08:18	1.57.2.12
  +++ test.pl	2000/05/29 14:22:11	1.57.2.13
  @@ -15,15 +15,15 @@
       'plain.htm',
   ##    'plainblock.htm',
   ##    'plainblock.htm',
  -    'error.htm???6',
  -    'error.htm???6',
  -    'error.htm???6',
  +    'error.htm???8',
  +    'error.htm???8',
  +    'error.htm???8',
   ##    'unclosed.htm???1',
   #    'errorright.htm???1',
       'notfound.htm???1',
       'notallow.xhtm???1',
   ##    'noerr/noerrpage.htm???6?2',
  -    'errdoc/errdoc.htm???6?262144',
  +    'errdoc/errdoc.htm???8?262144',
   ##    'rawinput/rawinput.htm????16',
       'var.htm',
       'varerr.htm???-1',
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.11  +43 -10    embperl/Embperl/Attic/Syntax.pm
  
  Index: Syntax.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/Syntax.pm,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- Syntax.pm	2000/05/29 07:34:31	1.1.2.10
  +++ Syntax.pm	2000/05/29 14:22:35	1.1.2.11
  @@ -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.10 2000/05/29 07:34:31 richter Exp $
  +#   $Id: Syntax.pm,v 1.1.2.11 2000/05/29 14:22:35 richter Exp $
   #
   ###################################################################################
   
  @@ -92,7 +92,7 @@
               embperl => { 
                       perlcode => 
                           [
  -                        'if (!defined (_ep_rp(%$n%,scalar(do{%#~0:$row|$col|$cnt%}))))
{ last ; }',
  +                        'if (!defined (_ep_rp(%$n%,scalar(do{%#~0:$row|$col|$cnt%}))))
{ last ; }  %^*-htmltable%',
                           '_ep_rp(%$n%,scalar(do{%#0%}));', 
                           ],
                       removenode  => 4,
  @@ -106,7 +106,7 @@
           'procinfo' => {
               embperl => { 
                           perlcode    => [
  -                                'if (!defined (scalar (do {%#~0:$row|$col|$cnt%}))) { last
; }',
  +                                'if (!defined (scalar (do {%#~0:$row|$col|$cnt%}))) { last
; } %^*-htmltable%',
                                   '{%#0%;}',
                                   ],
                           removenode  => 3,
  @@ -152,7 +152,7 @@
   $CmdsLink{'Embperl output code'}{'nodename'} = '[+url' ;
   $CmdsLink{'Embperl output code'}{'procinfo'}{'embperl'}{'perlcode'} = 
                           [
  -                        'if (!defined (_ep_rpurl(%$n%,scalar(do{%#~0:$row|$col|$cnt%}))))
{ last ; }',
  +                        'if (!defined (_ep_rpurl(%$n%,scalar(do{%#~0:$row|$col|$cnt%}))))
{ last ; } %^*-htmltable%',
                           '_ep_rpurl(%$n%,scalar(do{%#0%}));', 
                           ] ;
   
  @@ -267,7 +267,7 @@
               embperl => { 
                   perlcode =>
                       [ 
  -                    'XML::Embperl::DOM::Node_appendChild (%$n%, HTML::Embperl::Syntax::ntypText,
$fdat{\'%#&*name%\'}) ;   %#!-0%',
  +                    'XML::Embperl::DOM::Node_appendChild (%$n%, HTML::Embperl::Syntax::ntypText,
$fdat{\'%&*name%\'}) ;   %#!-0%',
                       '$idat{\'%&*name%\'} = \'%#*0%\' ; ',
                       ]
                   }                     
  @@ -282,6 +282,14 @@
           'text' => 'tr',
           'nodetype'   => ntypStartTag, 
           %HtmlTagsStd,
  +        'procinfo' => {
  +            embperl => { 
  +                perlcode    => 'for (my $col = 0; $col < $maxcol; $col++) {' ,
  +                perlcodeend => '}' ,
  +                stackname   => 'htmltable',
  +                push        => '1',
  +                }                     
  +            },
           },
       '/tr' => {
           'text' => '/tr',
  @@ -292,6 +300,14 @@
           'text' => 'table',
           'nodetype'   => ntypStartTag, 
           %HtmlTagsStd,
  +        'procinfo' => {
  +            embperl => { 
  +                perlcode    => 'for (my $row = 0; $row < $maxrow; $row++) {' ,
  +                perlcodeend => '}' ,
  +                stackname   => 'htmltable',
  +                push        => '1',
  +                }                     
  +            },
            },
       '/table' => {
           'text' => '/table',
  @@ -310,21 +326,38 @@
            },
       'select' => {
           'text' => 'select',
  +        'nodetype'   => ntypStartTag, 
           'inside' => 
               {
               'name'  => { 'text' => 'name',  'nodename' => 'name', follow =>
\%AssignAttr },
  +            %Cmds,
               },
  -        'nodetype'   => ntypStartTag, 
  -        %HtmlTagsStd,
  +        'procinfo' => {
  +            embperl => { 
  +                stackname   => 'htmlselect',
  +                push        => '%&*name%',
  +                }                     
  +            },
            },
       'option' => {
           'text' => 'option',
  +        'nodetype'   => ntypStartTag, 
  +        %HtmlTagsStd,
           'inside' => 
               {
  -            'value' => { 'text' => 'value', 'nodename' => 'value', follow =>
\%AssignAttr },
  +            'value'  => { 'text' => 'value',  'nodename' => 'value',  follow =>
\%AssignAttr },
  +            'selected' => { 'text' => 'selected', 'nodetype'   => ntypAttr, },
  +            %Cmds,
               },
  -        'nodetype'   => ntypStartTag, 
  -        %HtmlTagsStd,
  +        'procinfo' => {
  +            embperl => { 
  +                perlcode =>
  +                    [ 
  +                    'if ($fdat{\'%^*htmlselect%\'} eq \'%&*value%\') { XML::Embperl::DOM::Element_setAttribut
(%$n%, \'selected\', undef) } else {XML::Embperl::DOM::Element_removeAttribut (%$n%, \'selected\')
};  %&*-value% ',
  +                    'if ($fdat{\'%^*htmlselect%\'} eq \'%#*0%\') { XML::Embperl::DOM::Element_setAttribut
(%$n%, \'selected\', undef) } else {XML::Embperl::DOM::Element_removeAttribut (%$n%, \'selected\')
};  %&*-value% ',
  +                    ]
  +                }                     
  +            },
            },
       '/option' => {
           'text' => '/option',
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.2   +4 -1      embperl/test/cmp/error.htm
  
  Index: error.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/cmp/error.htm,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- error.htm	2000/05/23 07:05:08	1.5.2.1
  +++ error.htm	2000/05/29 14:23:14	1.5.2.2
  @@ -10,7 +10,10 @@
   ^<br>&nbsp;&nbsp;&nbsp;&nbsp;syntax error at test/html/error.htm
line \d+, at EOF
   ^<br>&nbsp;&nbsp;&nbsp;&nbsp;syntax error at test/html/error.htm
line \d+, near &quot;\$error is here &quot;
   ^<br>&nbsp;&nbsp;&nbsp;&nbsp;syntax error at test/html/error.htm
line \d+, near &quot;}
  -^<br>&nbsp;&nbsp;&nbsp;&nbsp;_ep_cp&quot;<p>
  +^<br>&nbsp;&nbsp;&nbsp;&nbsp;_ep_cp&quot;
  +^<br>&nbsp;&nbsp;&nbsp;&nbsp;syntax error at test/html/error.htm
line \d+, near &quot;}
  +^<br>&nbsp;&nbsp;&nbsp;&nbsp;
  +^<br>&nbsp;&nbsp;&nbsp;&nbsp;}&quot;<p>
   ^\[.*?\]ERR:  24: Line \d+: Error in Perl code: <p>
   ^ HTML\:\:Embperl.*?<P>
   </BODY></HTML>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.5   +5 -1      embperl/test/html/input.htm
  
  Index: input.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/input.htm,v
  retrieving revision 1.9.2.4
  retrieving revision 1.9.2.5
  diff -u -r1.9.2.4 -r1.9.2.5
  --- input.htm	2000/05/29 07:34:32	1.9.2.4
  +++ input.htm	2000/05/29 14:23:43	1.9.2.5
  @@ -1,4 +1,8 @@
  -<input type="checkbox" value="cbv1" name="cb1" checked >
  +    <textarea Name=feld1></textarea>
  +    <textarea Name=feld5></textarea>
  +
  +    <textarea Name=feld1>text1</textarea>
  +    <textarea Name=feld5>text5</textarea>
   
   
   <html>
  
  
  
  1.4.2.1   +12 -0     embperl/test/html/table.htm
  
  Index: table.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/table.htm,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- table.htm	1999/11/17 07:29:37	1.4
  +++ table.htm	2000/05/29 14:23:44	1.4.2.1
  @@ -7,6 +7,17 @@
   
   <table>
       <tr>
  +        <td>[+ $c[$row] +] </td>
  +    </tr> 
  +</table>
  +<table>
  +    <tr>
  +        <td>[+ $c[$col] +] </td>
  +    </tr> 
  +</table>
  +[#
  +<table>
  +    <tr>
           <td>[+ $c[$row][$col] +] </td>
       </tr> 
   </table>
  @@ -233,3 +244,4 @@
   
   </body>
   </html>
  +#]
  \ No newline at end of file
  
  
  

Mime
View raw message