unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* [Patch] etags support for php5
@ 2007-09-22 15:28 Bas Kok
  0 siblings, 0 replies; only message in thread
From: Bas Kok @ 2007-09-22 15:28 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

Hi all,

PHP5 introduced public, private and protected access modifiers for
methods and properties, class constants and the static keyword.
However etags currently does not recognize methods and properties
qualified with these keywords, therefore I added these.

I am not sure what the process is for having this added to cvs emacs,
therefore I added the patch for this to this email.

Regards,
-- 
Bas

[-- Attachment #2: etags.patch --]
[-- Type: application/octet-stream, Size: 1570 bytes --]

*** etags.c	13 Aug 2007 15:41:27 +0200	3.77
--- etags.c	22 Sep 2007 16:11:55 +0200	
***************
*** 4669,4674 ****
--- 4669,4707 ----
  		    lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
  	  search_identifier = FALSE;
  	}
+       else if (LOOKING_AT (cp, "public") ||
+ 	       LOOKING_AT (cp, "private") ||
+ 	       LOOKING_AT (cp, "protected") ||
+ 	       LOOKING_AT (cp, "static"))
+ 	{
+ 	  cp = skip_spaces (cp);
+ 	  if (LOOKING_AT (cp, "function"))
+ 	    {
+ 	      if(*cp == '&')
+ 		cp = skip_spaces (cp+1);
+ 	      if(*cp != '\0')
+ 		{
+ 		  name = cp;
+ 		  while (!notinname (*cp))
+ 		    cp++;
+ 		  make_tag (name, cp - name, TRUE,
+ 			    lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
+ 		}
+ 	      else
+ 		search_identifier = TRUE;
+ 	    }
+ 	  else if (members
+ 		   && *cp == '$')
+ 	    {
+ 	      name = cp;
+ 	      while (!notinname(*cp))
+ 		cp++;
+ 	      make_tag (name, cp - name, FALSE,
+ 			lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
+ 	    }
+ 	  else
+ 	    search_identifier = TRUE;	    
+ 	}
        else if (LOOKING_AT (cp, "function"))
  	{
  	  if(*cp == '&')
***************
*** 4710,4716 ****
  		    lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
  	}
        else if (members
! 	       && LOOKING_AT (cp, "var")
  	       && *cp == '$')
  	{
  	  name = cp;
--- 4743,4750 ----
  		    lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
  	}
        else if (members
! 	       && (LOOKING_AT (cp, "var") 
! 		   || LOOKING_AT (cp, "const"))
  	       && *cp == '$')
  	{
  	  name = cp;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-22 15:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-22 15:28 [Patch] etags support for php5 Bas Kok

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).