[Geany-devel] [Patch] - Improve PHP parser (call tips)

Can Koy cankoy at xxxxx
Sun Mar 7 18:11:01 UTC 2010


--- On Sun, 3/7/10, Enrico Tröger <enrico.troeger at uvena.de> wrote:

> From: Enrico Tröger <enrico.troeger at uvena.de>
> Subject: Re: [Geany-devel] [Patch] - Improve PHP parser (call tips)
> To: geany-devel at uvena.de
> Date: Sunday, March 7, 2010, 4:50 PM
> On Fri, 5 Mar 2010 12:21:25 -0800
> (PST), Can wrote:
> 
> >Hi,
> >The following patch adds call tips for functions in PHP code.
> >The regex pattern for function parameters is not optimal, but should
> >work for most cases. When you have a problem, send the relevant
> >function definition so that I can improve the patch.
> 
> Awesome (though I still think it'd be better in thelong term to write
> a C-based, real parser insteaf of fiddling with regexps).
> 
> I tweaked the patch a bit to work also with functions wth a modifier
> (public, private, ...) as it worked before (which was a patch by
> Harold, IIRC). I hope I didn't put more bugs into it than
> before :).

You put a weird pattern:
[public|protected|private|static]*
If you wanted to group, you should use ()

I thought it would be better to handle methods after nested scopes are implemented, that's why I left access modifiers out. 
Anyway, if you want something, just ask, you don't have to do everything.

> Also, there might be cases where the code could crash due
> to invalid
> memory accesses, these have to be found.
> 

I see you put a second if block. But, is there a case where match_funcname can be NULL if the first if condition is already true? If not, you should merge the second with the first.

--


      




More information about the Devel mailing list