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 Wed, 03 May 2000 14:03:52 GMT
richter     00/05/03 07:03:52

  Modified:    .        Tag: Embperl2 Embperl.pm Makefile.PL embperl.h
                        epio.c epparse.c test.pl
               Embperl  Tag: Embperl2 Tokens.pm
               test/html Tag: Embperl2 input.htm
  Added:       .        Tag: Embperl2 epdom.c
  Log:
  Embperl 2 - Paser & DOM
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.104.2.2 +2 -2      embperl/Embperl.pm
  
  Index: Embperl.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl.pm,v
  retrieving revision 1.104.2.1
  retrieving revision 1.104.2.2
  diff -u -r1.104.2.1 -r1.104.2.2
  --- Embperl.pm	2000/05/02 14:28:19	1.104.2.1
  +++ Embperl.pm	2000/05/03 14:03:49	1.104.2.2
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: Embperl.pm,v 1.104.2.1 2000/05/02 14:28:19 richter Exp $
  +#   $Id: Embperl.pm,v 1.104.2.2 2000/05/03 14:03:49 richter Exp $
   #
   ###################################################################################
   
  @@ -81,7 +81,7 @@
   @ISA = qw(Exporter DynaLoader);
   
   
  -$VERSION = '1.3b4_dev';
  +$VERSION = '2.0b1_dev';
   
   
   # HTML::Embperl cannot be bootstrapped in nonlazy mode except
  
  
  
  1.28.2.2  +1 -1      embperl/Makefile.PL
  
  Index: Makefile.PL
  ===================================================================
  RCS file: /home/cvs/embperl/Makefile.PL,v
  retrieving revision 1.28.2.1
  retrieving revision 1.28.2.2
  diff -u -r1.28.2.1 -r1.28.2.2
  --- Makefile.PL	2000/05/02 14:28:19	1.28.2.1
  +++ Makefile.PL	2000/05/03 14:03:49	1.28.2.2
  @@ -812,7 +812,7 @@
   WriteMakefile(
       'NAME'	   => 'HTML::Embperl',
       'VERSION_FROM' => 'Embperl.pm', 		# finds $VERSION
  -    'OBJECT'     => 'Embperl$(OBJ_EXT) epmain$(OBJ_EXT) epio$(OBJ_EXT) epchar$(OBJ_EXT)
epcmd$(OBJ_EXT) eputil$(OBJ_EXT) epeval$(OBJ_EXT) epdbg$(OBJ_EXT) epparse$(OBJ_EXT)' . $o,
  +    'OBJECT'     => 'Embperl$(OBJ_EXT) epmain$(OBJ_EXT) epio$(OBJ_EXT) epchar$(OBJ_EXT)
epcmd$(OBJ_EXT) eputil$(OBJ_EXT) epeval$(OBJ_EXT) epdbg$(OBJ_EXT) epparse$(OBJ_EXT) epdom$(OBJ_EXT)'
. $o,
       'LIBS'	   => [''],   			 
       'DEFINE'	   => "$d \$(DEFS)", 			 
       'INC'	   => $i,     			 
  
  
  
  1.17.2.2  +30 -1     embperl/embperl.h
  
  Index: embperl.h
  ===================================================================
  RCS file: /home/cvs/embperl/embperl.h,v
  retrieving revision 1.17.2.1
  retrieving revision 1.17.2.2
  diff -u -r1.17.2.1 -r1.17.2.2
  --- embperl.h	2000/05/02 14:28:19	1.17.2.1
  +++ embperl.h	2000/05/03 14:03:49	1.17.2.2
  @@ -101,7 +101,8 @@
       dbgProfile          = 0x100000,
       dbgSession          = 0x200000,
       dbgImport		= 0x400000,
  -    dbgBuildToken   = 0x800000,
  +    dbgBuildToken       = 0x800000,
  +    dbgParse            = 0x1000000,
       
       dbgAll  = -1
       } ;
  @@ -187,4 +188,32 @@
   #endif
   
   extern pid_t nPid ;
  +
  +/*
  +  Node Types
  +*/
  +
  +
  +enum tNodeType
  +    {
  +    ntypCDATA	    = 1,
  +    ntypTag	    = 2,
  +    ntypStartTag    = 3,
  +    ntypEndTag	    = 4,
  +    ntypAttr	    = 5,
  +    ntypAttrValue   = 6,
  +    } ;
  +
  +
  +
  +struct tNode
  +    {
  +    enum tNodeType	nType ;
  +    const char *	sText ;
  +    struct tNode *	pFirstChild ;
  +    struct tNode *	pLastChild ;
  +    struct tNode *	pSibling ;
  +    struct tNode *	pParent ;
  +    } ;
  +
   
  
  
  
  1.15.2.1  +19 -0     embperl/epio.c
  
  Index: epio.c
  ===================================================================
  RCS file: /home/cvs/embperl/epio.c,v
  retrieving revision 1.15
  retrieving revision 1.15.2.1
  diff -u -r1.15 -r1.15.2.1
  --- epio.c	2000/03/14 05:15:49	1.15
  +++ epio.c	2000/05/03 14:03:50	1.15.2.1
  @@ -1206,3 +1206,22 @@
       return p ;
       }
       
  +char * _ep_memdup (/*i/o*/ register req * r,
  +                  /*in*/  const char *   str,
  +                  /*in*/  int            len)
  +
  +    {
  +    char * p ;        
  +
  +    p = (char *)_malloc (r, len + 1) ;
  +
  +    if (p)
  +        {
  +        memcpy (p, str, len) ;
  +
  +        p[len] = '\0' ;
  +        }
  +
  +    return p ;
  +    }
  +    
  
  
  
  1.1.2.4   +177 -61   embperl/Attic/epparse.c
  
  Index: epparse.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epparse.c,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- epparse.c	2000/05/03 07:17:39	1.1.2.3
  +++ epparse.c	2000/05/03 14:03:50	1.1.2.4
  @@ -16,22 +16,29 @@
   #include "ep.h"
   #include "epmacro.h"
   
  +
  +typedef   unsigned char tCharMap [256/(sizeof(unsigned char)*8)]   ;
  +
   struct tToken
       {
       const char *    sText ;     /* string of token */
       int             nTextLen ;  /* len of string */
       const char *    sEndText ;  /* string which ends the block */
       const char *    sNodeName;  /* name of the node to create */
  +    enum tNodeType  nNodeType ; /* type of the node that should be created */
  +    unsigned char *      pContains ; /* chars that could becontains in the string */
       struct tTokenTable * pFollowedBy ; /* table of tokens that can follow this one */
       struct tTokenTable * pInside ;   /* table of tokens that can apear inside this one
*/
       } ;        
   
   struct tTokenTable
       {
  -    unsigned char   cStartChars [256/sizeof(unsigned char)] ;
  -    unsigned char   cAllChars   [256/sizeof(unsigned char)] ;
  -    struct tToken * pTokens ;
  -    int             numTokens ;
  +    tCharMap	    cStartChars ;   /* for every vaild start char there is one bit set */
  +    tCharMap	    cAllChars   ;   /* for every vaild char there is one bit set */
  +    struct tToken * pTokens ;	    /* table with all tokens */
  +    int             numTokens ;	    /* number of tokens in above table */
  +    int		    bLSearch ;	    /* when set perform a linear, instead of a binary search */
  +    struct tToken * pContainsToken ;
       } ;
   
   
  @@ -54,6 +61,17 @@
       }
       
   /* ------------------------------------------------------------------------ */
  +/* compare tokens for descending order                                      */
  +/* ------------------------------------------------------------------------ */
  +
  +static int CmpTokenDesc (/*in*/ const void *  p1,
  +                     /*in*/ const void *  p2)
  +
  +    {
  +    return strcmp (*((const char * *)p2), *((const char * *)p1)) ;
  +    }
  +    
  +/* ------------------------------------------------------------------------ */
   /*                                                                          */
   /* BuildSubTokenTable                                                       */
   /*                                                                          */
  @@ -129,12 +147,14 @@
       struct tToken * p ;
       IV		    l	 ;
       int		    n ;
  +    int		    i ;
       unsigned char * pStartChars = pTokenTable -> cStartChars ;
       unsigned char * pAllChars	= pTokenTable -> cAllChars ;
       
       memset (pStartChars, 0, sizeof (pTokenTable -> cStartChars)) ;
       memset (pAllChars,   0, sizeof (pTokenTable -> cAllChars)) ;
  -    
  +    pTokenTable -> bLSearch = 0 ;    
  +    pTokenTable -> pContainsToken = NULL ;
   
       numTokens = 1 ;
       hv_iterinit (pTokenHash) ;
  @@ -142,7 +162,8 @@
   	{
   	pKey     = hv_iterkey (pEntry, &l) ;
   	pToken   = hv_iterval (pTokenHash, pEntry) ;
  -        numTokens++ ;
  +        if (*pKey != '-') 
  +	    numTokens++ ;
           }
               
       if ((pTable = _malloc (r, sizeof (struct tToken) * numTokens)) == NULL)
  @@ -154,50 +175,82 @@
           {
           HV *   pHash ;
   	struct tTokenTable * pNewTokenTable ;
  +	char *  sContains ;
           
           pKey     = hv_iterkey (pEntry, &l) ;
           pToken   = hv_iterval (pTokenHash, pEntry) ;
           
  -        if (!SvROK (pToken) || SvTYPE (SvRV (pToken)) != SVt_PVHV)
  -            {
  -            strncpy (r -> errdat1, "BuildTokenHash", sizeof (r -> errdat1)) ;
  -            sprintf (r -> errdat2, "%s", pKey) ;
  -            return rcNotHashRef ;
  -            }
  -        pHash = (HV *)SvRV (pToken) ;
  +	if (*pKey == '-')
  +	    { /* special key */
  +	    if (strcmp (pKey, "-lsearch") == 0)
  +		{
  +		pTokenTable -> bLSearch = SvIV ((SV *)pToken) ;
  +		}
  +	    }
  +	else
  +	    {
  +	    if (!SvROK (pToken) || SvTYPE (SvRV (pToken)) != SVt_PVHV)
  +		{
  +		strncpy (r -> errdat1, "BuildTokenHash", sizeof (r -> errdat1)) ;
  +		sprintf (r -> errdat2, "%s", pKey) ;
  +		return rcNotHashRef ;
  +		}
  +	    pHash = (HV *)SvRV (pToken) ;
           
  -        p = &pTable[n] ;
  -        p -> sText = GetHashValueStr (pHash, "text", "") ;
  -        p -> nTextLen = strlen (p -> sText) ;
  -        p -> sEndText = GetHashValueStr (pHash, "end", pDefEnd) ;
  -        p -> sNodeName = GetHashValueStr (pHash, "nodename", NULL) ;
  +	    p = &pTable[n] ;
  +	    p -> sText     = GetHashValueStr (pHash, "text", "") ;
  +	    p -> nTextLen  = strlen (p -> sText) ;
  +	    p -> sEndText  = GetHashValueStr (pHash, "end", pDefEnd) ;
  +	    p -> sNodeName = GetHashValueStr (pHash, "nodename", NULL) ;
  +	    p -> nNodeType = GetHashValueInt (pHash, "nodetype", ntypTag) ;
  +	    if (sContains  = GetHashValueStr (pHash, "contains", NULL))
  +		{
  +		unsigned char * pC ;
  +		if ((p -> pContains = _malloc (r, sizeof (tCharMap))) == NULL)
  +		    return rcOutOfMemory ;
  +
  +		pC = p -> pContains ;
  +		while (*sContains)
  +		    {
  +		    pC[*sContains >> 3] |= 1 << (*sContains & 7) ;
  +		    sContains++ ;
  +		    }
  +		
  +		}
  +
   
  -        c = p -> sText ;
  -	pStartChars [*c >> 3] |= 1 << (*c & 7) ;
  +	    c = p -> sText ;
  +	    pStartChars [*c >> 3] |= 1 << (*c & 7) ;
           
  -	while (*c)
  -	    {
  -	    pAllChars [*c >> 3] |= 1 << (*c & 7) ;
  -	    c++ ;
  -	    }
  +	    while (*c)
  +		{
  +		pAllChars [*c >> 3] |= 1 << (*c & 7) ;
  +		c++ ;
  +		}
   
  -        if (r -> bDebug & dbgBuildToken)
  -            lprintf (r, "[%d]TOKEN: %s ... %s\n", r -> nPid, p -> sText, p ->
sEndText) ; 
  +	    if (r -> bDebug & dbgBuildToken)
  +		lprintf (r, "[%d]TOKEN: %s ... %s\n", r -> nPid, p -> sText, p -> pContains?sContains:p
-> sEndText) ; 
           
  -        if ((rc = BuildSubTokenTable (r, pHash, pKey, "follow", p -> sEndText, &pNewTokenTable)))
  -	    return rc ;
  -	p -> pFollowedBy = pNewTokenTable ;
  -
  -        if ((rc = BuildSubTokenTable (r, pHash, pKey, "inside", p -> sEndText, &pNewTokenTable)))
  -	    return rc ;
  -        p -> pInside     = pNewTokenTable ;
  +	    if ((rc = BuildSubTokenTable (r, pHash, pKey, "follow", p -> sEndText, &pNewTokenTable)))
  +		return rc ;
  +	    p -> pFollowedBy = pNewTokenTable ;
  +
  +	    if ((rc = BuildSubTokenTable (r, pHash, pKey, "inside", p -> sEndText, &pNewTokenTable)))
  +		return rc ;
  +	    p -> pInside     = pNewTokenTable ;
   
  -	
  -        n++ ;
  -        }
  +	    
  +	    n++ ;
  +	    }
  +	}
  +
  +    qsort (pTable, numTokens - 1, sizeof (struct tToken), pTokenTable -> bLSearch?CmpTokenDesc:CmpToken)
;
   
  -    qsort (pTable, numTokens - 1, sizeof (struct tToken), CmpToken) ;
   
  +    for (i = 0; i < n; i++)
  +	if (pTable[i].pContains)
  +	    pTokenTable -> pContainsToken = &pTable[i] ;
  +    
       p = &pTable[n] ;
       p -> sText = "" ;
       p -> nTextLen = 0 ;
  @@ -223,13 +276,14 @@
       {
       struct tTokenCmp * c = (struct tTokenCmp *)p1 ;
       int                i ;
  +    int	p1Len = c -> nLen ;
  +    int p2Len = ((struct tToken *)p2) -> nTextLen ;
   
  -    //printf ("strncmp (%s, %s, %d)\n", c -> pStart, *((const char * *)p2), c ->
nLen) ;
  -    if ((i = strncmp (c -> pStart, *((const char * *)p2), c -> nLen)) == 0)
  +    if ((i = strnicmp (c -> pStart, *((const char * *)p2), p1Len)) == 0)
   	{
  -	if (c -> nLen == ((struct tToken *)p2) -> nTextLen)
  +	if (p1Len == p2Len)
   	    return 0 ;
  -	else if (c -> nLen > ((struct tToken *)p2) -> nTextLen)
  +	else if (p1Len > p2Len)
   	    return 1 ;
   	return -1 ;
   	}
  @@ -245,19 +299,24 @@
   /*                                                                          */
   /* ------------------------------------------------------------------------ */
   
  -int ParseTokens (/*in */ char * *   ppCurr, 
  +int ParseTokens (/*i/o*/ register req *	  r,
  +		 /*in */ char * *   ppCurr, 
                       char *          pEnd, 
                       struct tTokenTable * pTokenTable, 
                       const char *          sEndText,
  +                    const char *          pParentContains,
   		    const char *          pParentNodeName,
  +		    struct tNode *        pParentNode,
   		    int			  level) 
   
       {
       unsigned char * pStartChars = pTokenTable -> cStartChars ;
       struct tTokenCmp c ;    
  -    int nEndText = strlen (sEndText) ;    
  +    int nEndText = sEndText?strlen (sEndText):0 ;    
       char * pCurr = *ppCurr  ;
       char * pCurrStart = pCurr ;
  +    struct tNode *pNewNode ;
  +    int	    rc ;
       
       while (pCurr < pEnd)
           {
  @@ -265,21 +324,45 @@
               {
   	    struct tToken * pToken = NULL ;
   	    struct tTokenTable * pNextTokenTab = pTokenTable ;
  -	    char * pNodeName  = NULL ;
  +	    const char * pNodeName  = NULL ;
  +	    enum tNodeType nNodeType = 0 ;
  +	    char * pCurrTokenStart = pCurr ;
   
  -            do
  +	    
  +	    do
                   {
   		struct tToken * pTokenTab = pNextTokenTab -> pTokens ;
   		int             numTokens = pNextTokenTab -> numTokens ;
   		unsigned char * pAllChars = pNextTokenTab -> cAllChars ;
  +
  +		if (pNextTokenTab -> bLSearch)
  +		    {
  +		    int r = 1 ;
  +		    int i ;
   
  -		c.pStart = pCurr ;
  +		    for (i = 0, pToken = pTokenTab; i < numTokens; i++, pToken++)
  +			{
  +			r = strncmp (pCurr, pToken -> sText, pToken -> nTextLen)  ;
  +			if (r == 0 || *pCurr > *(pToken -> sText))
  +			    break ;
  +			}
  +		    if (r != 0)
  +		    	pToken = NULL ;
  +		    else
  +			pCurr += pToken -> nTextLen ;
  +		    }
  +		else
  +		    {
  +		    c.pStart = pCurr ;
   
  -		while (pAllChars [*pCurr >> 3] & (1 << (*pCurr & 7)))
  -		    pCurr++ ;
  +		    while (pAllChars [*pCurr >> 3] & (1 << (*pCurr & 7)))
  +			pCurr++ ;
                   
  -		c.nLen = pCurr - c.pStart ;
  -		if (pToken = (struct tToken *)bsearch (&c, pTokenTab, numTokens, sizeof (struct tToken),
CmpTokenN))
  +		    c.nLen = pCurr - c.pStart ;
  +		    pToken = (struct tToken *)bsearch (&c, pTokenTab, numTokens, sizeof (struct tToken),
CmpTokenN) ;
  +		    }
  +
  +		if (pToken)
                       {
                       while (isspace (*pCurr))
                           pCurr++ ;
  @@ -288,40 +371,73 @@
   			pNodeName = pToken -> sNodeName ;
   		    }
                   else
  -                    break ;
  -                }
  +		    {
  +		    pToken = pNextTokenTab -> pContainsToken ;
  +		    break ;
  +		    }
  +		}
               while (pNextTokenTab = pToken -> pFollowedBy) ;
               
               if (pToken)
                   {        
                   struct tTokenTable * pInside ;                
   
  +		if (pCurrStart < pCurrTokenStart)
  +		    {
  +		    if ((rc = CreateNode (r, ntypCDATA, pCurrStart, pCurrTokenStart - pCurrStart, pParentNode,
level, &pNewNode)) != ok)
  +			return rc ;
  +		    pCurrStart = pCurrTokenStart ;
  +		    }
  +            
   		if (pNodeName == NULL)
   		    pNodeName = pToken -> sText ;
  -                printf ("\n%*s--> %s:", level * 4, " ", pNodeName) ;
  +		if ((rc = CreateNode (r, pToken -> nNodeType, pNodeName, strlen (pNodeName), pParentNode,
level, &pNewNode)) != ok)
  +		    return rc ;
                   if (pInside = pToken -> pInside)
                       {
  -                    ParseTokens (&pCurr, pEnd, pInside, pToken -> sEndText, pNodeName,
level+1) ;
  +                    ParseTokens (r, &pCurr, pEnd, pInside, pToken -> sEndText, pToken
-> pContains, pNodeName, pNewNode, level+1) ;
                       }    
                   else
                       {
  -                    char * pEndCurr = strstr (pCurr, 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)
   			{
  -			printf (" %*.*s <-- %s", pEndCurr - pCurr, pEndCurr - pCurr, pCurr, pNodeName) ;
  +			if (pEndCurr - pCurr)
  +			    if ((rc = CreateNode (r, ntypCDATA, pCurr, pEndCurr - pCurr, pNewNode, level+1,
&pNewNode)) != ok)
  +				return rc ;
                           pCurr = pEndCurr + strlen (pToken -> sEndText) ;
   			}
                       }
                   pCurrStart = pCurr ;
   		}
  +            }
  +        if (pParentContains && ((pParentContains [*pCurr >> 3] & 1 <<
(*pCurr & 7)) == 0) )
  +            {
  +	    if (pCurr - pCurrStart)
  +		if ((rc = CreateNode (r, ntypCDATA, pCurrStart, pCurr - pCurrStart, pParentNode, level,
&pNewNode)) != ok)
  +		    return rc ;
  +	    break ;
               }
  -        if (*pCurr == *sEndText && strncmp (pCurr, sEndText, nEndText) == 0)
  +        else if (sEndText == NULL ||
  +	    (*pCurr == *sEndText && strncmp (pCurr, sEndText, nEndText) == 0))
               {
  -            printf (" %*.*s <-- %s", pCurr - pCurrStart, pCurr - pCurrStart, pCurrStart,
pParentNodeName) ;
  +	    if (pCurr - pCurrStart)
  +		if ((rc = CreateNode (r, ntypCDATA, pCurrStart, pCurr - pCurrStart, pParentNode, level,
&pNewNode)) != ok)
  +		    return rc ;
               pCurr += nEndText ;
   	    break ;
               }
  -        pCurr++ ;
  +        else
  +	    pCurr++ ;
           }
           
       *ppCurr = pCurr ;
  @@ -361,7 +477,7 @@
   	return rc ;
   	}
   
  -    return ParseTokens (&pStart, pEnd, &pTable, "", "root", 0) ; 
  +    return ParseTokens (r, &pStart, pEnd, &pTable, "", NULL, "root", NULL, 0) ;

   
   
       }
  
  
  
  1.57.2.3  +1 -1      embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.57.2.2
  retrieving revision 1.57.2.3
  diff -u -r1.57.2.2 -r1.57.2.3
  --- test.pl	2000/05/03 07:17:39	1.57.2.2
  +++ test.pl	2000/05/03 14:03:50	1.57.2.3
  @@ -207,7 +207,7 @@
   $port    = $EPPORT ;
   $host    = 'localhost' ;
   $httpdpid = 0 ;
  -$defaultdebug = 0xf85ffd ;
  +$defaultdebug = 0x1f85ffd ;
   
   
   if ($cmdarg =~ /\?/)
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +73 -0     embperl/Attic/epdom.c
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +49 -9     embperl/Embperl/Attic/Tokens.pm
  
  Index: Tokens.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/Tokens.pm,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- Tokens.pm	2000/05/03 07:17:40	1.1.2.2
  +++ Tokens.pm	2000/05/03 14:03:51	1.1.2.3
  @@ -1,25 +1,36 @@
   
   package HTML::Embperl::Tokens ;
   
  +use constant  ntypCDATA	    => 1 ;
  +use constant  ntypTag       => 2 ;
  +use constant  ntypStartTag  => 3 ;
  +use constant  ntypEndTag    => 4 ;
  +use constant  ntypAttr	    => 5 ;
  +use constant  ntypAttrValue => 6 ;
   
  +
   %Attr = (
  +    '-lsearch' => 1,
       'Attribut ""' => 
           {
           'text'   => '"',
           'end'    => '"',
           'inside' => \%Cmds,
  +        'nodetype'   => ntypAttrValue,
           },
       'Attribut \'\'' => 
           {
           'text'   => '\'',
           'end'    => '\'',
           'inside' => \%Cmds,
  +        'nodetype'   => ntypAttrValue,
           },
  -    #'Attribut' => 
  -    #    {
  -    #    'contains'   => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789',
  -    #    'inside' => \%Cmds,
  -    #    }
  +    'Attribut alphanum' => 
  +        {
  +        'contains'   => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789',
  +        'inside' => \%Cmds,
  +        'nodetype'   => ntypAttrValue,
  +        }
       ) ;
   
   
  @@ -37,27 +48,54 @@
           'text' => 'input',
           'inside' => 
               {
  -            'type'  => { 'text' => 'type',  'nodename' => 'type',  follow =>
\%AssignAttr },
  -            'name'  => { 'text' => 'name',  'nodename' => 'name',  follow =>
\%AssignAttr },
  -            'value' => { 'text' => 'value', 'nodename' => 'value', follow =>
\%AssignAttr },
  +            'type'  => { 'text' => 'type',  'nodename' => 'type',  'nodetype'
  => ntypAttr, follow => \%AssignAttr },
  +            'name'  => { 'text' => 'name',  'nodename' => 'name',  'nodetype'
  => ntypAttr, follow => \%AssignAttr },
  +            'value' => { 'text' => 'value', 'nodename' => 'value', 'nodetype'
  => ntypAttr, follow => \%AssignAttr },
               }
            },
       'tr' => {
           'text' => 'tr',
  +        'nodetype'   => ntypStartTag, 
  +         },
  +    '/tr' => {
  +        'text' => '/tr',
  +        'nodetype'   => ntypEndTag, 
            },
       'table' => {
           'text' => 'table',
  +        'nodetype'   => ntypStartTag, 
  +         },
  +    '/table' => {
  +        'text' => '/table',
  +        'nodetype'   => ntypEndTag, 
            },
       'th' => {
           'text' => 'th',
  +        'nodetype'   => ntypStartTag, 
            },
  +    '/th' => {
  +        'text' => '/th',
  +        'nodetype'   => ntypEndTag, 
  +         },
       'select' => {
           'text' => 'select',
           'inside' => 
  +            {
  +            'name'  => { 'text' => 'name',  'nodename' => 'name', 'nodetype' 
 => ntypAttr, follow => \%AssignAttr },
  +            },
  +        'nodetype'   => ntypStartTag, 
  +         },
  +    'option' => {
  +        'text' => 'select',
  +        'inside' => 
               {
  -            'name'  => { 'text' => 'name',  follow => \%AssignAttr },
  +            'value' => { 'text' => 'value', 'nodename' => 'value', 'nodetype'
  => ntypAttr, follow => \%AssignAttr },
               }
            },
  +    '/select' => {
  +        'text' => '/select',
  +        'nodetype'   => ntypEndTag, 
  +         },
       'body' => {
           'text' => 'body',
            },
  @@ -106,6 +144,7 @@
   
   
   %Cmds = (
  +    '-lsearch' => 1,
       'Embperl meta command' => {
           'text' => '[$',
           'end'  => '$]',
  @@ -131,6 +170,7 @@
      
   
   %Main = (
  +    '-lsearch' => 1,
       'HTML Tag' => {
           'text' => '<',
           'end'  => '>',
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.1   +7 -0      embperl/test/html/input.htm
  
  Index: input.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/input.htm,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  --- input.htm	1999/10/05 06:03:45	1.9
  +++ input.htm	2000/05/03 14:03:51	1.9.2.1
  @@ -1,3 +1,4 @@
  +    <table border="0" width="100%">
   <html>
   
   <head>
  @@ -19,6 +20,9 @@
   <form action="inhalt.htm" method="POST">
       <p>&nbsp;</p>
   
  +    <input name=neu1 value="[+ 1 > 2 +]" >
  +    <input name=[+ $name +] value="[+ 1 > 2 +]">
  +
       <input>
       <input  >
       <input name="feld1">
  @@ -33,6 +37,9 @@
       <input typo = "text2" >
       <input foo>
       <input foo >
  +
  +    <input name=neu1 value="[+ 1 > 2 +]">
  +    <input name='neu2' value=">>">
     
       <input type="text" name="feld1" value="Wert1">
       <input type="text" name="feld2">
  
  
  

Mime
View raw message