Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 108116 Details for
Bug 132880
php5 patch for ctags
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
PHP5 patch freshly from ctags' SVN repository
ctags-5.6-php5.patch (text/plain), 2.84 KB, created by
Dirk Tilger
on 2007-01-25 11:44:17 UTC
(
hide
)
Description:
PHP5 patch freshly from ctags' SVN repository
Filename:
MIME Type:
Creator:
Dirk Tilger
Created:
2007-01-25 11:44:17 UTC
Size:
2.84 KB
patch
obsolete
>Index: php.c >=================================================================== >--- php.c (.../tags/Ctags-5_6/php.c) (revision 488) >+++ php.c (.../trunk/php.c) (revision 488) >@@ -42,6 +42,43 @@ > * FUNCTION DEFINITIONS > */ > >+/* JavaScript patterns are duplicated in jscript.c */ >+ >+static void installPHPRegex (const langType language) >+{ >+ addTagRegex(language, "(^|[ \t])class[ \t]+([A-Za-z\x7F-\xFF_][0-9A-Za-z\x7F-\xFF_]*)", >+ "\\2", "c,class,classes", NULL); >+ addTagRegex(language, "(^|[ \t])interface[ \t]+([A-Za-z\x7F-\xFF_][0-9A-Za-z\x7F-\xFF_]*)", >+ "\\2", "i,interface,interfaces", NULL); >+ addTagRegex(language, "(^|[ \t])define[ \t]*\\([ \t]*['\"]?([A-Za-z\x7F-\xFF_][0-9A-Za-z\x7F-\xFF_]*)", >+ "\\2", "d,define,constant definitions", NULL); >+ addTagRegex(language, "(^|[ \t])function[ \t]+&?[ \t]*([A-Za-z\x7F-\xFF_][0-9A-Za-z\x7F-\xFF_]*)", >+ "\\2", "f,function,functions", NULL); >+ addTagRegex(language, "(^|[ \t])\\$([A-Za-z\x7F-\xFF_][0-9A-Za-z\x7F-\xFF_]*)[ \t]*=", >+ "\\2", "v,variable,variables", NULL); >+ >+ // function regex is covered by PHP regex >+ addTagRegex (language, "(^|[ \t])([A-Za-z0-9_]+)[ \t]*[=:][ \t]*function[ \t]*\\(", >+ "\\2", "j,jsfunction,javascript functions", NULL); >+ addTagRegex (language, "(^|[ \t])([A-Za-z0-9_.]+)\\.([A-Za-z0-9_]+)[ \t]*=[ \t]*function[ \t]*\\(", >+ "\\2.\\3", "j,jsfunction,javascript functions", NULL); >+ addTagRegex (language, "(^|[ \t])([A-Za-z0-9_.]+)\\.([A-Za-z0-9_]+)[ \t]*=[ \t]*function[ \t]*\\(", >+ "\\3", "j,jsfunction,javascript functions", NULL); >+} >+ >+/* Create parser definition stucture */ >+extern parserDefinition* PhpParser (void) >+{ >+ static const char *const extensions [] = { "php", "php3", "phtml", NULL }; >+ parserDefinition* def = parserNew ("PHP"); >+ def->extensions = extensions; >+ def->initialize = installPHPRegex; >+ def->regex = TRUE; >+ return def; >+} >+ >+#if 0 >+ > static boolean isLetter(const int c) > { > return (boolean)(isalpha(c) || (c >= 127 && c <= 255)); >@@ -65,6 +102,7 @@ > while ((line = fileReadLine ()) != NULL) > { > const unsigned char *cp = line; >+ const char* f; > > while (isspace (*cp)) > cp++; >@@ -87,17 +125,23 @@ > vStringClear (name); > } > } >- else if (strncmp ((const char*) cp, "function", (size_t) 8) == 0 && >- isspace ((int) cp [8])) >+ else if ((f = strstr ((const char*) cp, "function")) != NULL && >+ (f == (const char*) cp || isspace ((int) f [-1])) && >+ isspace ((int) f [8])) > { >- cp += 8; >+ cp = ((const unsigned char *) f) + 8; > > while (isspace ((int) *cp)) > ++cp; > >- if (*cp == '&') /* skip reference character */ >+ if (*cp == '&') /* skip reference character and following whitespace */ >+ { > cp++; > >+ while (isspace ((int) *cp)) >+ ++cp; >+ } >+ > vStringClear (name); > while (isalnum ((int) *cp) || *cp == '_') > { >@@ -168,4 +212,6 @@ > return def; > } > >+#endif >+ > /* vi:set tabstop=4 shiftwidth=4: */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 132880
:
86539
|
87794
| 108116