all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo Liu <sdl.web@gmail.com>
To: cavd <cavandusen@gmail.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>,
	Luca Ferrari <fluca1978@infinito.it>
Subject: Re: etags and php classes
Date: Fri, 04 Apr 2014 07:45:08 +0800	[thread overview]
Message-ID: <m3txaat1tn.fsf@gmail.com> (raw)
In-Reply-To: <65DB79BD-C772-444A-9944-D23567A0A610@gmail.com> (cavd's message of "Thu, 3 Apr 2014 13:00:45 -0500")

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

On 2014-04-04 02:00 +0800, cavd wrote:
> You might try GNU Global; it's pretty nice. 
>
> Chris. 

I use global CVS + php.diff (attached) + ggtags.el. The patch should
make Global usable for php5.

If you install Global with the right plugin it can support many
languages reasonably nicely with the ability to find both definitions
and references. See
https://github.com/leoliu/ggtags#install-global-and-plugins

HTH,
Leo


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: php.diff --]
[-- Type: text/x-patch, Size: 4305 bytes --]

From cde42478e8e8666974a8ed261084c6fa2f96b563 Mon Sep 17 00:00:00 2001
From: Leo Liu <sdl.web@gmail.com>
Date: Wed, 5 Mar 2014 14:41:14 +0800
Subject: [PATCH 1/2] Update reserved words for PHP

---
 libparser/php_res.in | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/libparser/php_res.in b/libparser/php_res.in
index 5f8bd754..84053ca3 100644
--- a/libparser/php_res.in
+++ b/libparser/php_res.in
@@ -13,17 +13,29 @@
 ;
 ; PHP reserved word list.
 ;
-__FILE__		word
+; http://us2.php.net/manual/en/language.constants.predefined.php
 __LINE__		word
+__FILE__		word
+__DIR__                 word
 __FUNCTION__		word
 __CLASS__		word
+__TRAIT__               word
+__METHOD__              word
+__NAMESPACE__           word
+;
+; http://us2.php.net/manual/en/reserved.keywords.php
+__halt_compiler,__HALT_COMPILER,__Halt_Compiler         word
+abstract,ABSTRACT,Abstract                              word
 and,AND,And						word
 array,ARRAY,Array					word
 as,AS,As						word
 break,BREAK,Break					word
+callable,CALLABLE,Callable                              word
 case,CASE,Case						word
+catch,CATCH,Catch                                       word
 cfunction,CFUNCTION,Cfunction,CFunction			word
 class,CLASS,Class					word
+clone,CLONE,Clone                                       word
 const,CONST,Const					word
 continue,CONTINUE,Continue				word
 declare,DECLARE,Declare					word
@@ -44,24 +56,36 @@ endwhile,ENDWHILE,Endwhile,EndWhile			word
 endswitch,ENDSWITCH,Endswitch,EndSwitch			word
 eval,EVAL,Eval						word
 exit,EXIT,Exit						word
+extends,EXTENDS,Extends				        word
 failure,FAILURE,Failure					word
 false,FALSE,False					word
+final,FINAL,Final					word
 for,FOR,For						word
 foreach,FOREACH,Foreach,ForEach				word
 function,FUNCTION,Function				word
 global,GLOBAL,Global					word
+goto,GOTO,Goto					        word
 header,HEADER,Header					word
 list,LIST,List						word
 if,IF,If						word
+implements,IMPLEMENTS,Implements			word
 include,INCLUDE,Include					word
 include_once,INCLUDE_ONCE,Include_once,Include_Once	word
+instanceof,INSTANCEOF,Instanceof			word
+insteadof,INSTEADOF,Insteadof				word
+interface,INTERFACE,Interface				word
 is_array,IS_ARRAY,Is_array,Is_Array			word
 is_set,IS_SET,Is_set,Is_Set				word
+isset,ISSET,Isset					word
+namespace,NAMESPACE,Namespace				word
 new,NEW,New						word
 old_function,OLD_FUNCTION,Old_function,Old_Function	word
 or,OR,Or						word
 print,PRINT,Print					word
 printf,PRINTF,Printf					word
+private,PRIVATE,Private					word
+protected,PROTECTED,Protected				word
+public,PUBLIC,Public					word
 return,RETURN,Return					word
 require,REQUIRE,Require					word
 require_once,REQUIRE_ONCE,Require_once,Require_Once	word
@@ -69,7 +93,11 @@ setcookie,SETCOOKIE,Setcookie,SetCookie			word
 success,SUCCESS,Success					word
 static,STATIC,Static					word
 switch,SWITCH,Switch					word
+throw,THROW,Throw					word
+trait,TRAIT,Trait					word
+try,TRY,Try					        word
 true,TRUE,True						word
+use,USE,Use					        word
 var,VAR,Var						word
 while,WHILE,While					word
 unset,UNSET,Unset					word
-- 
1.9.1.352.gd393d14


From a72fafcda8b9fb53baad122903ce7cbf28ebe5a6 Mon Sep 17 00:00:00 2001
From: Leo Liu <sdl.web@gmail.com>
Date: Wed, 5 Mar 2014 17:01:04 +0800
Subject: [PATCH 2/2] update php lexer

---
 libparser/php.l | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libparser/php.l b/libparser/php.l
index 584112bc..24459042 100644
--- a/libparser/php.l
+++ b/libparser/php.l
@@ -298,6 +298,12 @@ php(const struct parser_param *param)
 			PUT(PARSER_DEF, strbuf_value(string), LEXLINENO);
 			break;
 		case PHP_CLASS:
+		case PHP_INTERFACE:
+			if (LEXLEX(param) != PHP_TOKEN)
+				break;
+			PUT(PARSER_DEF, LEXTEXT, LEXLINENO);
+			break;
+		case PHP_CONST:
 			if (LEXLEX(param) != PHP_TOKEN)
 				break;
 			PUT(PARSER_DEF, LEXTEXT, LEXLINENO);
@@ -309,6 +315,11 @@ php(const struct parser_param *param)
 				break;
 			PUT(PARSER_DEF, LEXTEXT, LEXLINENO);
 			break;
+		case PHP_TRAIT:
+			if (LEXLEX(param) != PHP_TOKEN)
+				break;
+			PUT(PARSER_DEF, LEXTEXT, LEXLINENO);
+			break;
 		case PHP_VARIABLE:
 			if (php_reserved_variable(LEXTEXT, LEXLENG)) {
 				PUT(PARSER_REF_SYM, LEXTEXT, LEXLINENO);
-- 
1.9.1.352.gd393d14


      reply	other threads:[~2014-04-03 23:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02  6:40 etags and php classes Luca Ferrari
2014-04-02 16:03 ` Eli Zaretskii
2014-04-03  6:27   ` Luca Ferrari
2014-04-03  9:47     ` Chris Van Dusen
2014-04-03 15:22       ` Luca Ferrari
2014-04-03 18:00         ` cavd
2014-04-03 23:45           ` Leo Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3txaat1tn.fsf@gmail.com \
    --to=sdl.web@gmail.com \
    --cc=cavandusen@gmail.com \
    --cc=fluca1978@infinito.it \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.