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
Date Thu, 04 May 2000 05:42:08 GMT
richter     00/05/03 22:42:07

  Modified:    .        Tag: Embperl2 epdom.c epparse.c
               Embperl  Tag: Embperl2 Tokens.pm
               test/html Tag: Embperl2 input.htm
  Log:
  
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +45 -0     embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- epdom.c	2000/05/03 20:57:30	1.1.2.2
  +++ epdom.c	2000/05/04 05:42:02	1.1.2.3
  @@ -17,6 +17,51 @@
   #include "epmacro.h"
   
   
  +/* ------------------------------------------------------------------------ 
  +
  +interface Node {
  +  // NodeType
  +  const unsigned short      ELEMENT_NODE       = 1;
  +  const unsigned short      ATTRIBUTE_NODE     = 2;
  +  const unsigned short      TEXT_NODE          = 3;
  +  const unsigned short      CDATA_SECTION_NODE = 4;
  +  const unsigned short      ENTITY_REFERENCE_NODE = 5;
  +  const unsigned short      ENTITY_NODE        = 6;
  +  const unsigned short      PROCESSING_INSTRUCTION_NODE = 7;
  +  const unsigned short      COMMENT_NODE       = 8;
  +  const unsigned short      DOCUMENT_NODE      = 9;
  +  const unsigned short      DOCUMENT_TYPE_NODE = 10;
  +  const unsigned short      DOCUMENT_FRAGMENT_NODE = 11;
  +  const unsigned short      NOTATION_NODE      = 12;
  +
  +  readonly attribute  DOMString            nodeName;
  +           attribute  DOMString            nodeValue;
  +                                                 // raises(DOMException) on setting
  +                                                 // raises(DOMException) on retrieval
  +  readonly attribute  unsigned short       nodeType;
  +  readonly attribute  Node                 parentNode;
  +  readonly attribute  NodeList             childNodes;
  +  readonly attribute  Node                 firstChild;
  +  readonly attribute  Node                 lastChild;
  +  readonly attribute  Node                 previousSibling;
  +  readonly attribute  Node                 nextSibling;
  +  readonly attribute  NamedNodeMap         attributes;
  +  readonly attribute  Document             ownerDocument;
  +  Node                      insertBefore(in Node newChild, 
  +                                         in Node refChild)
  +                                         raises(DOMException);
  +  Node                      replaceChild(in Node newChild, 
  +                                         in Node oldChild)
  +                                         raises(DOMException);
  +  Node                      removeChild(in Node oldChild)
  +                                        raises(DOMException);
  +  Node                      appendChild(in Node newChild)
  +                                        raises(DOMException);
  +  boolean                   hasChildNodes();
  +  Node                      cloneNode(in boolean deep);
  +};
  +
  +*/
   
   
   /* ------------------------------------------------------------------------ */
  
  
  
  1.1.2.6   +42 -36    embperl/Attic/epparse.c
  
  Index: epparse.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epparse.c,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- epparse.c	2000/05/03 20:57:30	1.1.2.5
  +++ epparse.c	2000/05/04 05:42:03	1.1.2.6
  @@ -219,8 +219,9 @@
   		    }
   		
   		}
  +	    else
  +		p -> pContains = NULL ;
   
  -
   	    c = p -> sText ;
   	    pStartChars [*c >> 3] |= 1 << (*c & 7) ;
           
  @@ -387,8 +388,9 @@
   
   		if (pCurrStart < pCurrTokenStart)
   		    {
  -		    if ((rc = CreateNode (r, nCDataType, pCurrStart, pCurrTokenStart - pCurrStart, pParentNode,
level, &pNewNode)) != ok)
  -			return rc ;
  +		    if (nCDataType)
  +			if ((rc = CreateNode (r, nCDataType, pCurrStart, pCurrTokenStart - pCurrStart, pParentNode,
level, &pNewNode)) != ok)
  +			    return rc ;
   		    pCurrStart = pCurrTokenStart ;
   		    }
               
  @@ -397,50 +399,54 @@
   		
   		if (pToken -> nNodeType == ntypEndTag && level > 0)
   		    {
  +		    char * pEndCurr = strstr (pCurr, pToken -> sEndText) ;
  +                    if (pEndCurr)
  +                        pCurr = pEndCurr + strlen (pToken -> sEndText) ;
   		    level-- ;
   		    pParentNode = pParentNode -> pParent ;
   		    }
  -		
  -		
  -		if ((rc = CreateNode (r, pToken -> nNodeType, pNodeName, strlen (pNodeName), pParentNode,
level, &pNewNode)) != ok)
  -		    return rc ;
  -		
  -		if (pInside = pToken -> pInside)
  -                    {
  -                    ParseTokens (r, &pCurr, pEnd, pInside, pToken -> sEndText, pToken
-> pContains, pToken -> nCDataType, pNodeName, pNewNode, level+1) ;
  -                    }    
  -                else
  -                    {
  -		    char * pEndCurr ;
  -		    unsigned char * pContains ;
  -		    if ((pContains = pToken -> pContains))
  +		else
  +		    {
  +		    if ((rc = CreateNode (r, pToken -> nNodeType, pNodeName, strlen (pNodeName), pParentNode,
level, &pNewNode)) != ok)
  +			return rc ;
  +		    
  +		    if (pInside = pToken -> pInside)
   			{
  -			pEndCurr = pCurr ;
  -			while (pContains [*pEndCurr >> 3] & (1 << (*pEndCurr & 7)))
  -			    pEndCurr++ ;
  -			}
  +			ParseTokens (r, &pCurr, pEnd, pInside, pToken -> sEndText, pToken -> pContains,
pToken -> nCDataType, pNodeName, pNewNode, level+1) ;
  +			}    
   		    else
  -			pEndCurr = strstr (pCurr, pToken -> sEndText) ;
  -                    if (pEndCurr)
   			{
  -			if (pEndCurr - pCurr)
  -			    if ((rc = CreateNode (r, pToken -> nCDataType, pCurr, pEndCurr - pCurr, pNewNode,
level+1, &pNewNode)) != ok)
  -				return rc ;
  -                        pCurr = pEndCurr + strlen (pToken -> sEndText) ;
  +			char * pEndCurr ;
  +			unsigned char * pContains ;
  +			if ((pContains = pToken -> pContains))
  +			    {
  +			    pEndCurr = pCurr ;
  +			    while (pContains [*pEndCurr >> 3] & (1 << (*pEndCurr & 7)))
  +				pEndCurr++ ;
  +			    }
  +			else
  +			    pEndCurr = strstr (pCurr, pToken -> sEndText) ;
  +			if (pEndCurr)
  +			    {
  +			    if (pEndCurr - pCurr && pToken -> nCDataType)
  +				if ((rc = CreateNode (r, pToken -> nCDataType, pCurr, pEndCurr - pCurr, pNewNode,
level+1, &pNewNode)) != ok)
  +				    return rc ;
  +			    pCurr = pEndCurr + strlen (pToken -> sEndText) ;
  +			    }
   			}
  -                    }
  -                pCurrStart = pCurr ;
   
  -		if (pToken -> nNodeType == ntypStartTag)
  -		    {
  -		    level++ ;
  -		    pParentNode = pNewNode ;
  +		    if (pToken -> nNodeType == ntypStartTag)
  +			{
  +			level++ ;
  +			pParentNode = pNewNode ;
  +			}
   		    }
  +		pCurrStart = pCurr ;
   		}
  -            }
  +	    }
           if (pParentContains && ((pParentContains [*pCurr >> 3] & 1 <<
(*pCurr & 7)) == 0) )
               {
  -	    if (pCurr - pCurrStart)
  +	    if (pCurr - pCurrStart && nCDataType)
   		if ((rc = CreateNode (r, nCDataType, pCurrStart, pCurr - pCurrStart, pParentNode, level,
&pNewNode)) != ok)
   		    return rc ;
   	    break ;
  @@ -448,7 +454,7 @@
           else if (sEndText == NULL ||
   	    (*pCurr == *sEndText && strncmp (pCurr, sEndText, nEndText) == 0))
               {
  -	    if (pCurr - pCurrStart)
  +	    if (pCurr - pCurrStart && nCDataType)
   		if ((rc = CreateNode (r, nCDataType, pCurrStart, pCurr - pCurrStart, pParentNode, level,
&pNewNode)) != ok)
   		    return rc ;
               pCurr += nEndText ;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +7 -1      embperl/Embperl/Attic/Tokens.pm
  
  Index: Tokens.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/Tokens.pm,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- Tokens.pm	2000/05/03 20:57:32	1.1.2.4
  +++ Tokens.pm	2000/05/04 05:42:04	1.1.2.5
  @@ -49,6 +49,7 @@
   %HtmlTags = (
       'input' => {
           'text' => 'input',
  +        'cdatatype'  => 0,
           'inside' => 
               {
               'type'  => { 'text' => 'type',  'nodename' => 'type',  follow =>
\%AssignAttr },
  @@ -93,7 +94,12 @@
           'inside' => 
               {
               'value' => { 'text' => 'value', 'nodename' => 'value', follow =>
\%AssignAttr },
  -            }
  +            },
  +        'nodetype'   => ntypStartTag, 
  +         },
  +    '/option' => {
  +        'text' => '/option',
  +        'nodetype'   => ntypEndTag, 
            },
       '/select' => {
           'text' => '/select',
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.2   +0 -1      embperl/test/html/input.htm
  
  Index: input.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/input.htm,v
  retrieving revision 1.9.2.1
  retrieving revision 1.9.2.2
  diff -u -r1.9.2.1 -r1.9.2.2
  --- input.htm	2000/05/03 14:03:51	1.9.2.1
  +++ input.htm	2000/05/04 05:42:06	1.9.2.2
  @@ -1,4 +1,3 @@
  -    <table border="0" width="100%">
   <html>
   
   <head>
  
  
  

Mime
View raw message