Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
Platform: Gentoo Linux.
I was browsing PEAR files when I spotted this. Functions that return references in PEAR are written:
These functions don't appear in the symbols list.
Can you provide an example file?
When I put the line
into a PHP file, func_name is detected properly.
PEAR MDB2 where function raiseError is not listed
My bad... Indeed, most functions beginning with an ampersand do appear. With the file I appended (MDB2.php) functions raiseError don't appear. I early deduced this was because of the ampersand but there now must be another reason.
Thanks for example.
The problem actually is that the list of arguments of that function is continued on the next line. The parser for PHP files is based on regular expressions which work line by line. And the used regular expression expects a final closing bracket on the same line as the function definition.
I tried to improve the used regex but i'm not so good with regular expressions and failed :(.
If anyone is interested, here is the used regular expression:
"^[ \t]*[(public|protected|private|static)[ \t]*]*[ \t]*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)[[:space:]]*(\\(.*\\))",
At the end of the regex, there should be something like "until the final closing ) OR a comma followed by zero or more whitespace until line end". I tried with: (\\(.*(\\)|(,[ \t]*$)) but this failed.
The relevant code is: http://geany.svn.sf.net/viewvc/geany/trunk/tagmanager/php.c
Have you tried with \r and \n ? I'm not sure but I also expect the regular expression engine uses new lines as a delimiter.
No, I didn't. I doubt that would work because the line which is parsed is most probably arelady stripped from trailing new line characters.
Should be fixed now in Git, thanks for reporting.
I reopen this because the underlying bug does not seem to be fixed properly. The parser recognizes the functions, but not the arguments. Consider this example:
function foobar($verylongargument, $secondlongarg,
This will only list me "foobar($verylongargument, $secondlongarg," for autocompletion, omitting the remaining arguments on the next line.
@kartoffelheinz it wasn't completely fixed at the time (more like a workaround), but it's really fixed in the current development version for some time now.
If you could test with the development version next time it'd be great :)
Thank you for letting me know.
I just verified it works like intended using the latest nightly build.