Skip to content

Instantly share code, notes, and snippets.

@duellj
Created November 9, 2011 05:38
Show Gist options
  • Select an option

  • Save duellj/1350521 to your computer and use it in GitHub Desktop.

Select an option

Save duellj/1350521 to your computer and use it in GitHub Desktop.
Ctags php functions
Index: php.c
===================================================================
--- php.c (revision 778)
+++ php.c (working copy)
@@ -64,18 +64,18 @@
static void installPHPRegex (const langType language)
{
- addTagRegex(language, "(^|[ \t])class[ \t]+([" ALPHA "_][" ALNUM "_]*)",
- "\\2", "c,class,classes", NULL);
- addTagRegex(language, "(^|[ \t])interface[ \t]+([" ALPHA "_][" ALNUM "_]*)",
- "\\2", "i,interface,interfaces", NULL);
- addTagRegex(language, "(^|[ \t])define[ \t]*\\([ \t]*['\"]?([" ALPHA "_][" ALNUM "_]*)",
- "\\2", "d,define,constant definitions", NULL);
- addTagRegex(language, "(^|[ \t])function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)",
- "\\2", "f,function,functions", NULL);
- addTagRegex(language, "(^|[ \t])(\\$|::\\$|\\$this->)([" ALPHA "_][" ALNUM "_]*)[ \t]*=",
+ addTagRegex(language, "^[ \t]*((final|abstract)[ \t]+)*class[ \t]+([" ALPHA "_][" ALNUM "_]*)",
+ "\\3", "c,class,classes", NULL);
+ addTagRegex(language, "^[ \t]*interface[ \t]+([" ALPHA "_][" ALNUM "_]*)",
+ "\\1", "i,interface,interfaces", NULL);
+ addTagRegex(language, "^[ \t]*define[ \t]*\\([ \t]*['\"]?([" ALPHA "_][" ALNUM "_]*)",
+ "\\1", "d,define,constant definitions", NULL);
+ addTagRegex(language, "^[ \t]*((static|public|protected|private)[ \t]+)*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)",
+ "\\3", "f,function,functions", NULL);
+ addTagRegex(language, "^[ \t]*(\\$|::\\$|\\$this->)([" ALPHA "_][" ALNUM "_]*)[ \t]*=",
+ "\\2", "v,variable,variables", NULL);
+ addTagRegex(language, "^[ \t]*((var|public|protected|private|static)[ \t]+)+\\$([" ALPHA "_][" ALNUM "_]*)[ \t]*[=;]",
"\\3", "v,variable,variables", NULL);
- addTagRegex(language, "(^|[ \t])(var|public|protected|private|static)[ \t]+\\$([" ALPHA "_][" ALNUM "_]*)[ \t]*[=;]",
- "\\3", "v,variable,variables", NULL);
/* function regex is covered by PHP regex */
addTagRegex (language, "(^|[ \t])([A-Za-z0-9_]+)[ \t]*[=:][ \t]*function[ \t]*\\(",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment