| 1 | --- php.c.orig 2007-12-28 11:40:08.000000000 -0500 |
| 2 | +++ php.c 2011-05-19 13:48:22.000000000 -0400 |
| 3 | @@ -11,6 +11,8 @@ |
| 4 | * variables. |
| 5 | * |
| 6 | * Parsing PHP defines by Pavel Hlousek <pavel.hlousek@seznam.cz>, Apr 2003. |
| 7 | +* Multiline comment fixes by David Mudrak <david.mudrak@gmail.com>, Jul 2009 |
| 8 | +* based on a patches by Sander Marechal <s.marechal@jejik.com>, Nov 2008. |
| 9 | */ |
| 10 | |
| 11 | /* |
| 12 | @@ -64,17 +66,17 @@ |
| 13 | |
| 14 | static void installPHPRegex (const langType language) |
| 15 | { |
| 16 | - addTagRegex(language, "(^|[ \t])class[ \t]+([" ALPHA "_][" ALNUM "_]*)", |
| 17 | - "\\2", "c,class,classes", NULL); |
| 18 | - addTagRegex(language, "(^|[ \t])interface[ \t]+([" ALPHA "_][" ALNUM "_]*)", |
| 19 | + addTagRegex(language, "(^[ \t]*)(abstract[ \t]+)?class[ \t]+([" ALPHA "_][" ALNUM "_]*)", |
| 20 | + "\\3", "c,class,classes", NULL); |
| 21 | + addTagRegex(language, "(^[ \t]*)interface[ \t]+([" ALPHA "_][" ALNUM "_]*)", |
| 22 | "\\2", "i,interface,interfaces", NULL); |
| 23 | - addTagRegex(language, "(^|[ \t])define[ \t]*\\([ \t]*['\"]?([" ALPHA "_][" ALNUM "_]*)", |
| 24 | + addTagRegex(language, "(^[ \t]*)define[ \t]*\\([ \t]*['\"]?([" ALPHA "_][" ALNUM "_]*)", |
| 25 | "\\2", "d,define,constant definitions", NULL); |
| 26 | - addTagRegex(language, "(^|[ \t])function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)", |
| 27 | - "\\2", "f,function,functions", NULL); |
| 28 | - addTagRegex(language, "(^|[ \t])(\\$|::\\$|\\$this->)([" ALPHA "_][" ALNUM "_]*)[ \t]*=", |
| 29 | + addTagRegex(language, "(^[ \t]*)(public[ \t]+|protected[ \t]+|private[ \t]+)?(static[ \t]+)?function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)", |
| 30 | + "\\4", "f,function,functions", NULL); |
| 31 | + addTagRegex(language, "(^[ \t]*)(\\$|::\\$|\\$this->)([" ALPHA "_][" ALNUM "_]*)[ \t]*=", |
| 32 | "\\3", "v,variable,variables", NULL); |
| 33 | - addTagRegex(language, "(^|[ \t])(var|public|protected|private|static)[ \t]+\\$([" ALPHA "_][" ALNUM "_]*)[ \t]*[=;]", |
| 34 | + addTagRegex(language, "(^[ \t]*)(var|public|protected|private|static)[ \t]+\\$([" ALPHA "_][" ALNUM "_]*)[ \t]*[=;]", |
| 35 | "\\3", "v,variable,variables", NULL); |
| 36 | |
| 37 | /* function regex is covered by PHP regex */ |
| 38 | @@ -89,7 +91,7 @@ |
| 39 | /* Create parser definition structure */ |
| 40 | extern parserDefinition* PhpParser (void) |
| 41 | { |
| 42 | - static const char *const extensions [] = { "php", "php3", "phtml", NULL }; |
| 43 | + static const char *const extensions [] = { "php", "php3", "php4", "php5", "phtml", NULL }; |
| 44 | parserDefinition* def = parserNew ("PHP"); |
| 45 | def->extensions = extensions; |
| 46 | def->initialize = installPHPRegex; |