Kaydet (Commit) 19fe99b1 authored tarafından Nick Treleaven's avatar Nick Treleaven

Fix parsing keyword-qualified functions strictly, e.g. don't

parse 'staticfunction' or 'fatfunction'.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/unstable@5986 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst b079b19d
2011-10-03 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* tagmanager/php.c:
Fix parsing keyword-qualified functions strictly, e.g. don't
parse 'staticfunction' or 'fatfunction'.
2011-09-30 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/utils.c, src/utils.h, src/editor.c:
......
......@@ -79,9 +79,13 @@ static void installPHPRegex (const langType language)
"\\1", "m,macro,macros", NULL);
addTagRegex(language, "^[ \t]*const[ \t]*([" ALPHA "_][" ALNUM "_]*)[ \t]*[=;]",
"\\1", "m,macro,macros", NULL);
/* Note: Using [] to match words is wrong, but using () doesn't seem to match 'function' on its own */
addCallbackRegex(language,
"^[ \t]*[(public|protected|private|static|final)[ \t]*]*[ \t]*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)[[:space:]]*(\\(.*\\))",
"^[ \t]*((public|protected|private|static|final)[ \t]+)+function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)[[:space:]]*(\\(.*\\))",
NULL, function_cb);
/* note: using (qualifiers)* instead of (qualifiers)+ in the above regex doesn't seem to
* match 'function' on its own, so we handle that separately: */
addCallbackRegex(language,
"^[ \t]*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)[[:space:]]*(\\(.*\\))",
NULL, function_cb);
addTagRegex(language, "^[ \t]*(\\$|::\\$|\\$this->)([" ALPHA "_][" ALNUM "_]*)[ \t]*=",
"\\2", "v,variable,variables", NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment