[Geany] 'function regex' in php.c
Harold Aling
geany at xxxxx
Tue Aug 18 08:52:02 UTC 2009
Dear Geany devs,
I've been tinkering with the regex in tagmanager/php.c to better
detect functions. My regex is still far from perfect, but I'll only
detect functions prefixed with either whitespace or on or more of
these: public, protected, private or static.
I'd guess a better approach would be to detect the opening parenthesis
'(' after the function name...
The first 2 commented 'functions' are indexed by the current regex as
the functions 'should' and 'would'.
/**
* This function should not be indexed
*/
// this function would also be indexed
Correct examples:
public static function this_one_will() {
function this_one_too() {
Cheers!
Harold.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tagmanager_php_c.patch
Type: text/x-diff
Size: 912 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20090818/4dedc38b/attachment.patch>
More information about the Users
mailing list