Improve parsing of PHP functions by requiring a valid modifier or whitespace before the 'function' keyword to ignore some false positives like function tags inside comments (patch by Harold Aling, thanks).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4124 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2009-08-25 21:23:14 +00:00
parent 43620e7ce4
commit 09b0b033ff
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2009-08-25 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* tagmanager/php.c:
Improve parsing of PHP functions by requiring a valid modifier or
whitespace before the 'function' keyword to ignore some false
positives like function tags inside comments
(patch by Harold Aling, thanks).
2009-08-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> 2009-08-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* data/filetypes.markdown: * data/filetypes.markdown:

View File

@ -76,8 +76,8 @@ static void installPHPRegex (const langType language)
"\\2", "i,interface,interfaces", NULL); "\\2", "i,interface,interfaces", NULL);
addTagRegex(language, "(^|[ \t])define[ \t]*\\([ \t]*['\"]?([" ALPHA "_][" ALNUM "_]*)", addTagRegex(language, "(^|[ \t])define[ \t]*\\([ \t]*['\"]?([" ALPHA "_][" ALNUM "_]*)",
"\\2", "d,macro,constant definitions", NULL); "\\2", "d,macro,constant definitions", NULL);
addTagRegex(language, "(^|[ \t])function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)", addTagRegex(language, "^[ \t]*((public|protected|private|static)[ \t]+)*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)",
"\\2", "f,function,functions", NULL); "\\3", "f,function,functions", NULL);
addTagRegex(language, "(^|[ \t])(\\$|::\\$|\\$this->)([" ALPHA "_][" ALNUM "_]*)[ \t]*=", addTagRegex(language, "(^|[ \t])(\\$|::\\$|\\$this->)([" ALPHA "_][" ALNUM "_]*)[ \t]*=",
"\\3", "v,variable,variables", NULL); "\\3", "v,variable,variables", NULL);
addTagRegex(language, "(^|[ \t])(var|public|protected|private|static)[ \t]+\\$([" ALPHA "_][" ALNUM "_]*)[ \t]*[=;]", addTagRegex(language, "(^|[ \t])(var|public|protected|private|static)[ \t]+\\$([" ALPHA "_][" ALNUM "_]*)[ \t]*[=;]",