* [Patch] etags support for php5
[not found] <88872ed0709220828n777b6802vbfe12a6ce52c599d@mail.gmail.com>
@ 2007-09-23 8:48 ` Bas Kok
2007-09-23 15:05 ` Richard Stallman
0 siblings, 1 reply; 3+ messages in thread
From: Bas Kok @ 2007-09-23 8:48 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 401 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, so I patched it a bit.
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;
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread